1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-03 21:10:05 +00:00

fix: add user to all users group on user creation

This commit is contained in:
2023-02-03 16:47:18 +05:00
parent b243e62ece
commit 2bae52e307
2 changed files with 14 additions and 7 deletions

View File

@@ -21,9 +21,9 @@ import {
getUserAutoExec,
updateUserAutoExec,
ModeType,
AuthProviderType
ALL_USERS_GROUP
} from '../utils'
import { GroupResponse } from './group'
import { GroupController, GroupResponse } from './group'
export interface UserResponse {
id: number
@@ -237,6 +237,13 @@ const createUser = async (data: UserPayload): Promise<UserDetailsResponse> => {
const savedUser = await user.save()
const groupController = new GroupController()
const allUsersGroup = await groupController.getGroupByGroupName(
ALL_USERS_GROUP.name
)
await groupController.addUserToGroup(allUsersGroup.groupId, savedUser.id)
return {
id: savedUser.id,
displayName: savedUser.displayName,