From 925cdccf7dd52d9bcf7650c51138148e7c8a1f3f Mon Sep 17 00:00:00 2001 From: BenShelton Date: Wed, 13 Feb 2019 12:58:43 +0000 Subject: [PATCH] allow assignment of week type even if not scraped --- database/schedule.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/database/schedule.js b/database/schedule.js index 6070e26..2fe2953 100644 --- a/database/schedule.js +++ b/database/schedule.js @@ -140,8 +140,7 @@ export const updateWeekType = async ({ weekID, language, type }) => { // Check the previous week didn't already have the same type const baseWeek = await coll.findOne(query) assert.notStrictEqual(null, baseWeek, 404) - const week = baseWeek[language] || null - assert.notStrictEqual(null, week, 404) + const week = baseWeek[language] || {} assert.notStrictEqual(type, week.type, 400) // Remove existing assigned members if necessary