user creation bug fix

This commit is contained in:
2025-05-06 18:12:56 +05:30
parent d6d25004b9
commit 174386d498
2 changed files with 6 additions and 4 deletions

View File

@@ -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(),

View File

@@ -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) {