Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed owner_id #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/todos/todo.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down