Add updated_at column to users table and remove debug logging from profile update handler
This commit is contained in:
@@ -159,6 +159,9 @@ class _AccountSettingsDialogState extends State<AccountSettingsDialog> {
|
|||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(content: Text('Profile updated successfully')),
|
const SnackBar(content: Text('Profile updated successfully')),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Close the dialog
|
||||||
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('DEBUG: _updateProfile error: $e');
|
print('DEBUG: _updateProfile error: $e');
|
||||||
|
|||||||
@@ -3857,7 +3857,6 @@ func getUserProfileHandler(w http.ResponseWriter, r *http.Request, db *database.
|
|||||||
|
|
||||||
// updateUserProfileHandler updates the current user's profile information
|
// updateUserProfileHandler updates the current user's profile information
|
||||||
func updateUserProfileHandler(w http.ResponseWriter, r *http.Request, db *database.DB, auditLogger *audit.Logger) {
|
func updateUserProfileHandler(w http.ResponseWriter, r *http.Request, db *database.DB, auditLogger *audit.Logger) {
|
||||||
log.Printf("DEBUG: updateUserProfileHandler called")
|
|
||||||
userIDStr, ok := middleware.GetUserID(r.Context())
|
userIDStr, ok := middleware.GetUserID(r.Context())
|
||||||
if !ok {
|
if !ok {
|
||||||
errors.WriteError(w, errors.CodeUnauthenticated, "Unauthorized", http.StatusUnauthorized)
|
errors.WriteError(w, errors.CodeUnauthenticated, "Unauthorized", http.StatusUnauthorized)
|
||||||
@@ -3881,8 +3880,6 @@ func updateUserProfileHandler(w http.ResponseWriter, r *http.Request, db *databa
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("DEBUG: updateUserProfileHandler req: displayName=%v, email=%v, avatarUrl=%v", req.DisplayName, req.Email, req.AvatarURL)
|
|
||||||
|
|
||||||
// Build dynamic update query
|
// Build dynamic update query
|
||||||
var setParts []string
|
var setParts []string
|
||||||
var args []interface{}
|
var args []interface{}
|
||||||
|
|||||||
1
go_cloud/migrations/0011_add_updated_at.sql
Normal file
1
go_cloud/migrations/0011_add_updated_at.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE users ADD COLUMN updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW();
|
||||||
Reference in New Issue
Block a user