This commit is contained in:
wood chen 2025-02-23 05:30:07 +08:00
parent 11bf5318f3
commit 71ad4d48ce

View File

@ -29,13 +29,11 @@ export async function PATCH(
home: data.home,
logo: data.logo,
redirectUri: data.redirectUri,
allowedUsers: Array.isArray(data.allowedUsers)
? data.allowedUsers
: undefined,
} satisfies Partial<Prisma.ClientUpdateInput>;
// 单独处理 allowedUsers 字段
if (Array.isArray(data.allowedUsers)) {
await prisma.$executeRaw`UPDATE clients SET "allowedUsers" = ${data.allowedUsers}::text[] WHERE id = ${params.id}`;
}
const updatedClient = await prisma.client.update({
where: { id: params.id },
data: updateData,