chore: bump @trpc/* and @tanstack/react-query (#13335)
Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: zomars <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: Gergő Móricz <[email protected]> Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
183 files changed
+1203
-1013
No files matched your search
@@ -57,9 +57,9 @@ function exclude<UserType, Key extends keyof UserType>(user: UserType, keys: Key
|
||||
/** Reusable logic that checks for admin permissions and if the requested user exists */
|
||||
//const authedAdminWithUserMiddleware = middleware();
|
||||
|
||||
const authedAdminProcedureWithRequestedUser = authedAdminProcedure.use(async ({ ctx, next, rawInput }) => {
|
||||
const authedAdminProcedureWithRequestedUser = authedAdminProcedure.use(async ({ ctx, next, getRawInput }) => {
|
||||
const { prisma } = ctx;
|
||||
const parsed = userIdSchema.safeParse(rawInput);
|
||||
const parsed = userIdSchema.safeParse(await getRawInput());
|
||||
if (!parsed.success) throw new TRPCError({ code: "BAD_REQUEST", message: "User id is required" });
|
||||
const { userId: id } = parsed.data;
|
||||
const user = await prisma.user.findUnique({ where: { id } });
|
||||
|
||||
Reference in new issue
Block a user