Sory users by created_at always.

This commit is contained in:
Kailash Nadh 2024-09-03 22:43:34 +05:30
parent 83d3af3527
commit 3cbf67b943

View file

@ -1082,7 +1082,8 @@ UPDATE users SET
WHEN $9 > 0 THEN (SELECT id FROM roles WHERE id = $9 AND type = 'list') WHEN $9 > 0 THEN (SELECT id FROM roles WHERE id = $9 AND type = 'list')
ELSE list_role_id END ELSE list_role_id END
), ),
status=(CASE WHEN $10 != '' THEN $10::user_status ELSE status END) status=(CASE WHEN $10 != '' THEN $10::user_status ELSE status END),
updated_at=NOW()
WHERE id=$1 AND (SELECT canEdit FROM u) = TRUE; WHERE id=$1 AND (SELECT canEdit FROM u) = TRUE;
-- name: delete-users -- name: delete-users
@ -1135,7 +1136,8 @@ FROM users
WHEN $3::TEXT != '' THEN email = $3 WHEN $3::TEXT != '' THEN email = $3
ELSE TRUE ELSE TRUE
END END
); )
ORDER BY users.created_at;
-- name: get-api-tokens -- name: get-api-tokens