Update operations.ts

This commit is contained in:
vincanger 2025-03-31 17:12:41 +02:00
parent 576d47a32e
commit 48a1d2a1cd

View File

@ -23,7 +23,6 @@ function setupOpenAI() {
} }
//#region Actions //#region Actions
const generateGptResponseInputSchema = z.object({ const generateGptResponseInputSchema = z.object({
hours: z.string().regex(/^\d+(\.\d+)?$/, 'Hours must be a number'), hours: z.string().regex(/^\d+(\.\d+)?$/, 'Hours must be a number'),
}); });
@ -233,6 +232,9 @@ export const updateTask: UpdateTask<UpdateTaskInput, Task> = async (rawArgs, con
const task = await context.entities.Task.update({ const task = await context.entities.Task.update({
where: { where: {
id, id,
user: {
id: context.user.id,
},
}, },
data: { data: {
isDone, isDone,
@ -259,6 +261,9 @@ export const deleteTask: DeleteTask<DeleteTaskInput, Task> = async (rawArgs, con
const task = await context.entities.Task.delete({ const task = await context.entities.Task.delete({
where: { where: {
id, id,
user: {
id: context.user.id,
},
}, },
}); });