Conversation
| }), | ||
| credentials: 'same-origin' | ||
| } | ||
| fetch('api/task/all', options) |
There was a problem hiding this comment.
can you use the function in this file - https://github.com/GuildCrafts/newbie/blob/master/src/browser/common/utils.js
| import { fetchURL, toStandardDate } from '../../../common/utils' | ||
| import moment from 'moment' | ||
|
|
||
| export default class OverdueTaskDashboard extends Component { |
There was a problem hiding this comment.
I think we're overloading the use of the name Dashboard. Please change to OverdueTask
|
|
||
| router.get('/all', (request, response, next) => { | ||
| Promise.all([task.getAll(), user.findAll() ]) | ||
| .then(results => response.json(results)) |
There was a problem hiding this comment.
Instead of returning all the tasks & users, can you write a new SQL query that fetches the overdue tasks(joined with the user's github handle)? There is too much work happening on the front end that can just be reduced to a SQL query
bd7e030 to
59ab0de
Compare
| findEmailByUUID( user_id ){ | ||
| for( let task of this.state.tasks ){ | ||
| if( task.user_id == user_id ){ | ||
| if(task.email !== null) { |
There was a problem hiding this comment.
these 2 if statements can be combined
| } | ||
|
|
||
|
|
||
| findEmailByUUID( user_id ){ |
There was a problem hiding this comment.
why does this function exist? Since you are now fetching the task, and the associated user of the task(by joining the task and user table), the email should be a property on the task object.
|
Is this still waiting on a review? |
Fixes 76 .
Overview
Adds view page for overdue tasks linked from admin dasheboard.
Data Model / DB Schema Changes
N/A
Environment / Configuration Changes
N/A
Notes
N/A