mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Fixed user group not actually updating on the backend
This commit is contained in:
@@ -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) },
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user