Instoring the status type
.
This commit is contained in:
1 parent
59743d7221
commit
8b53cf1539
7 files changed
+35
-2
No files matched your search
@@ -4,6 +4,7 @@ import {
|
||||
} from 'graphql';
|
||||
import { EventType } from '../types';
|
||||
import { Event } from '../../models';
|
||||
import { UNPUBLISHED, ARCHIVED } from '../../enums/EventStatus';
|
||||
|
||||
const args = {
|
||||
minDate: { type: GraphQLInt },
|
||||
@@ -12,6 +13,7 @@ const args = {
|
||||
|
||||
const resolve = (parent, { minDate, maxDate }) => Event.find(
|
||||
Object.assign(
|
||||
{ status: { $nin: [UNPUBLISHED, ARCHIVED] } },
|
||||
minDate || maxDate
|
||||
? {
|
||||
startDatetime:
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
} from 'graphql';
|
||||
import { EventType } from '../types';
|
||||
import { Event } from '../../models';
|
||||
import { UNPUBLISHED, ARCHIVED } from '../../enums/EventStatus';
|
||||
|
||||
const args = {
|
||||
hostId: { type: GraphQLString },
|
||||
@@ -14,7 +15,7 @@ const args = {
|
||||
|
||||
const resolve = (parent, { hostId, minDate, maxDate }, context) => Event.find(
|
||||
Object.assign(
|
||||
hostId ? { hostId } : { hostId: context.userId },
|
||||
hostId ? { hostId, status: { $nin: [UNPUBLISHED, ARCHIVED] } } : { hostId: context.userId },
|
||||
minDate || maxDate
|
||||
? {
|
||||
startDatetime:
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from 'graphql';
|
||||
import { EventType } from '../types';
|
||||
import { Event } from '../../models';
|
||||
import { UNPUBLISHED, ARCHIVED } from '../../enums/EventStatus';
|
||||
|
||||
const args = {
|
||||
teamId: { type: new GraphQLNonNull(GraphQLString) },
|
||||
@@ -15,7 +16,11 @@ const args = {
|
||||
|
||||
const resolve = (parent, { teamId, minDate, maxDate }) => Event.find(
|
||||
Object.assign(
|
||||
{ participants: { $elemMatch: { teamId } } },
|
||||
{
|
||||
participants: { $elemMatch: { teamId } },
|
||||
status: { $nin: [UNPUBLISHED, ARCHIVED] },
|
||||
},
|
||||
|
||||
minDate || maxDate
|
||||
? {
|
||||
startDatetime:
|
||||
|
||||
Reference in new issue
Block a user