From fab83b13cad1109d4b498cd3a8767b74a4f07850 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 11 Feb 2019 14:30:58 +0100 Subject: [PATCH] Adding the "UNPUBLISH" case, that should never happen --- src/schema/mutations/ChangeEventState.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schema/mutations/ChangeEventState.js b/src/schema/mutations/ChangeEventState.js index a4395ee32..4d005a9e4 100644 --- a/src/schema/mutations/ChangeEventState.js +++ b/src/schema/mutations/ChangeEventState.js @@ -33,6 +33,8 @@ const resolve = (parent, { eventId: _id, state }, { userId: hostId }) => { } switch (state) { + case UNPUBLISHED: + throw new NotImplementedYetError('Still working on it'); case PUBLISHED: return new Promise((res, rej) => { Event.findOneAndUpdate({ _id, hostId, state: UNPUBLISHED }, { state }, { new: true }, (err, modifiedEvent) => {