user creation bug fix
This commit is contained in:
@@ -96,9 +96,9 @@ const userResponse = z.object({
|
||||
pid: z.string(),
|
||||
orgId: z
|
||||
.object({
|
||||
_id: z.string(),
|
||||
pid: z.string(),
|
||||
name: z.string(),
|
||||
_id: z.string().optional(),
|
||||
pid: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
firstName: z.string().optional(),
|
||||
|
||||
@@ -52,7 +52,9 @@ export async function createUser(
|
||||
}">here</a> to register.`
|
||||
);
|
||||
|
||||
return newUser;
|
||||
return userModel
|
||||
.findOne({ pid: newUser.pid })
|
||||
.populate({ path: "orgId", select: "pid name avatar" });
|
||||
}
|
||||
|
||||
export async function getUser(userId: string) {
|
||||
|
||||
Reference in New Issue
Block a user