Skip to content

Commit 02ac3c6

Browse files
authored
Update operations.ts (wasp-lang#402)
1 parent 576d47a commit 02ac3c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

template/app/src/demo-ai-app/operations.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ function setupOpenAI() {
2323
}
2424

2525
//#region Actions
26-
2726
const generateGptResponseInputSchema = z.object({
2827
hours: z.string().regex(/^\d+(\.\d+)?$/, 'Hours must be a number'),
2928
});
@@ -233,6 +232,9 @@ export const updateTask: UpdateTask<UpdateTaskInput, Task> = async (rawArgs, con
233232
const task = await context.entities.Task.update({
234233
where: {
235234
id,
235+
user: {
236+
id: context.user.id,
237+
},
236238
},
237239
data: {
238240
isDone,
@@ -259,6 +261,9 @@ export const deleteTask: DeleteTask<DeleteTaskInput, Task> = async (rawArgs, con
259261
const task = await context.entities.Task.delete({
260262
where: {
261263
id,
264+
user: {
265+
id: context.user.id,
266+
},
262267
},
263268
});
264269

0 commit comments

Comments
 (0)