Fixed user group not actually updating on the backend

This commit is contained in:
Tatu Laras
2025-06-18 14:03:10 +03:00
parent 71491b845b
commit ee3f05fd79
+3 -4
View File
@@ -1,11 +1,10 @@
import { nowDb } from '../../utils/db'
export const validUserGroups = ['su', 'eu', 'er', 'pl', 'plp', 'no', 'ro']
export type UserGroup = 'su' | 'eu' | 'er' | 'pl' | 'plp' | 'no' | 'ro'
export const validUserGroups = ['su (admin)', 'eu (edit unrestricted)', 'er (edit restricted)', 'ro (read only)']
export type UserGroup = 'su (admin)' | 'eu (edit unrestricted)' | 'er (edit restricted)' | 'ro (read only)'
export const writeUserGroup = async (user_id: number, group: UserGroup) => {
await nowDb.com_users.update({
where: { user_id: user_id },
data: { now_user_group: group },
data: { now_user_group: group.substring(0, 2) },
})
}