Skip to content

Commit 0f7d777

Browse files
committed
fixDateFilterForSelfServices
1 parent 92f41ac commit 0f7d777

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/integrations/gei-bookings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gei-bookings",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Automatically generated by graphql-editor-cli",
55
"main": "lib/index.js",
66
"scripts": {

packages/integrations/gei-bookings/src/UserQuery/getSelfServices.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const getSelfServices = async (input: FieldResolveInput) =>
1414
const po = preparePageOptions(args?.input?.page);
1515
const pa =
1616
args?.input?.filters &&
17-
Object.fromEntries(Object.entries(args?.input?.filters).filter((v) => v !== null && v !== undefined));
17+
Object.fromEntries(Object.entries(args?.input?.filters).filter((v) => v !== null && v !== undefined && v[0] !== 'fromDate' && v[0] !== 'toDate'));
1818
const fromDate = isScalarDate(args?.input?.filters?.fromDate)
1919
? isScalarDate(args?.input?.filters?.fromDate)
2020
: undefined;
@@ -25,8 +25,8 @@ export const getSelfServices = async (input: FieldResolveInput) =>
2525
const selfServices = await MongoOrb(ServicesCollection)
2626
.collection.find({
2727
...pa,
28-
...(fromDate && { createdAt: { $gte: new Date(args?.input?.filters?.fromDate as string) } }),
29-
...(toDate && { createdAt: { $lte: new Date(args?.input?.filters?.toDate as string) } }),
28+
...(fromDate && { startDate: { $gte: new Date(args?.input?.filters?.fromDate as string) } }),
29+
...(toDate && { startDate: { $lte: new Date(args?.input?.filters?.toDate as string) } }),
3030
...(args?.input?.filters?.name && { name: { $regex: args?.input.filters.name, $options: 'i' } }),
3131
...(args?.input?.filters?.description && {
3232
description: { $regex: args?.input.filters.description, $options: 'i' },

0 commit comments

Comments
 (0)