add blocked user
All checks were successful
deploy / build-and-deploy (push) Successful in 15s

This commit is contained in:
2025-05-20 23:34:54 +02:00
parent ba1146facf
commit 8b18623232
14 changed files with 390 additions and 1 deletions

View File

@@ -84,5 +84,41 @@ export const user = {
users: users
};
}
}),
addBlocked: defineAction({
input: z.object({
uuid: z.string(),
comment: z.string().nullable()
}),
handler: async (input, context) => {
Session.actionSessionFromCookies(context.cookies, Permissions.Users);
const { id } = await db.addBlockedUser(input);
return {
id: id
};
}
}),
editBlocked: defineAction({
input: z.object({
id: z.number(),
uuid: z.string(),
comment: z.string().nullable()
}),
handler: async (input, context) => {
Session.actionSessionFromCookies(context.cookies, Permissions.Users);
await db.editBlockedUser(input);
}
}),
blocked: defineAction({
handler: async (_, context) => {
Session.actionSessionFromCookies(context.cookies, Permissions.Users);
return {
blocked: await db.getBlockedUsers({})
};
}
})
};