doubtfire-lms / doubtfire-web

Angular web application for the Doubtfire front-end
GNU Affero General Public License v3.0
45 stars 333 forks source link

Support getting task details using id #859

Open keraan opened 5 months ago

keraan commented 5 months ago

The following is code from selected-task-service.ts. None of the code elsewhere ever uses selectedTaskService.setSelectedTask(number), so this code never ran before. Attempting to gives the following error: GET http://localhost:3000/api//projects//task_def_id/ 400 (Bad Request)

public setSelectedTask(task: number | Task) {
    if (typeof task === 'number') {
      this.taskService.get(task).subscribe(this.task$);    // THIS LINE HERE
    } else {
      this.task$.next(task);

      task?.getSubmissionDetails().subscribe();
    }
    this.checkFooterHeight();
    this.showSubmission();
  }
keraan commented 5 months ago

@macite