Fix lint and formatting issues
- Sort imports alphabetically in helpers.ts and router.ts - Simplify boolean comparison in users/update.ts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
* Admin procedure helpers - shared transformation functions
|
||||
*/
|
||||
|
||||
import type { OrgSites, Orgs, Users } from "@reviq/db-schema";
|
||||
import type { Selectable } from "kysely";
|
||||
import type { Orgs, OrgSites, Users } from "@reviq/db-schema";
|
||||
|
||||
/** Transform org record to API response format */
|
||||
export const toOrgResponse = (org: Selectable<Orgs>) => ({
|
||||
|
||||
@@ -27,10 +27,7 @@ export const adminUsersUpdate = os.admin.users.update
|
||||
}
|
||||
|
||||
// Prevent superuser from demoting themselves
|
||||
if (
|
||||
isSuperuser === false &&
|
||||
normalizedEmail === context.user.email.toLowerCase()
|
||||
) {
|
||||
if (!isSuperuser && normalizedEmail === context.user.email.toLowerCase()) {
|
||||
throw new ORPCError("BAD_REQUEST", {
|
||||
message: "Cannot remove your own superuser status",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user