Adding the "UNPUBLISH" case, that should never happen
This commit is contained in:
1 parent
20831364ef
commit
fab83b13ca
1 file changed
+2
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user