We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1167bef commit e5760d5Copy full SHA for e5760d5
lib/javascript/fullstack_demo/src/repositories/postgres-todo-repository.ts
@@ -27,7 +27,7 @@ export class PostgresTodoRepository implements TodoRepository {
27
28
async patch(todo: Partial<Todo>, userId: string): Promise<Todo | undefined> {
29
const dbTodo = await client.todos.update({
30
- where: { id: todo.id },
+ where: { id: todo.id, user_id: userId },
31
data: {
32
text: todo.text,
33
completed: todo.completed,
@@ -43,6 +43,6 @@ export class PostgresTodoRepository implements TodoRepository {
43
}
44
45
async delete(id: number, userId: string): Promise<void> {
46
- await client.todos.delete({ where: { id } });
+ await client.todos.delete({ where: { id, user_id: userId } });
47
48
0 commit comments