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