From 7b0f11a1f488c1a8fd61507332a481ad90ec736c Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 7 Sep 2019 13:01:05 -0400 Subject: [PATCH] [F] Fix assignments null --- src/components/app/app.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/app/app.ts b/src/components/app/app.ts index 5d6661a..5449641 100644 --- a/src/components/app/app.ts +++ b/src/components/app/app.ts @@ -134,8 +134,21 @@ export default class App extends Vue // Get response body text res.text().then(text => { - // Parse json and filter it - course.assignments = JsonUtils.filterAssignments(JSON.parse(text)); + // Parse response + let response = JSON.parse(text); + + // Check success + if (response.success) + { + // Load assignments + // Parse json and filter it + course.assignments = JsonUtils.filterAssignments(response.data); + } + else + { + // Show error message TODO: Show it properly + alert(response.data); + } }) }) .catch(err =>