From 16550d0c9111ee910d04f6622b05c4f46af71576 Mon Sep 17 00:00:00 2001 From: Pushpakant Behera Date: Sat, 3 Apr 2021 14:58:55 +0545 Subject: [PATCH] fixed owner_id --- api/todos/todo.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/todos/todo.service.js b/api/todos/todo.service.js index 026e7ac..66c466a 100644 --- a/api/todos/todo.service.js +++ b/api/todos/todo.service.js @@ -22,7 +22,7 @@ module.exports = { missingTodo: ({ google_token }) => { return new Promise(async (resolve, reject) => { let sql = - 'SELECT class_works.*, (SELECT name FROM users WHERE classroom.owner_id = users.user_id) as owner_name, classroom.class_name FROM class_works JOIN classroom ON (classroom.class_code = class_works.class_code) JOIN classes ON (classes.class_code = class_works.class_code) JOIN users ON (users.user_id = classes.user_id) AND users.google_token = ? AND class_works.type = 0 AND class_works.due_date < current_timestamp()'; + 'SELECT class_works.*, (SELECT users.name FROM users WHERE classroom.owner_id = users.user_id) as owner_name,(SELECT users.google_token FROM users WHERE classroom.owner_id = users.user_id) as owner_id, classroom.class_name FROM class_works JOIN classroom ON (classroom.class_code = class_works.class_code) JOIN classes ON (classes.class_code = class_works.class_code) JOIN users ON (users.user_id = classes.user_id) AND users.google_token = ? AND class_works.type = 0 AND class_works.due_date < current_timestamp()'; await pool.query(sql, [google_token], (error, result, field) => { if (error) {