From 2e4bc084cea4f3a07606a5dce0ae3f3341200ab0 Mon Sep 17 00:00:00 2001 From: PrabalSingh Date: Mon, 8 Jun 2020 18:28:31 +0530 Subject: [PATCH] remove redundant code and excludeTopic-->excludeEvent --- api/graphql/query/Resource/availability.js | 2 +- api/services/ZoomAccount/index.js | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/api/graphql/query/Resource/availability.js b/api/graphql/query/Resource/availability.js index 4f9959d..cba538e 100644 --- a/api/graphql/query/Resource/availability.js +++ b/api/graphql/query/Resource/availability.js @@ -17,7 +17,7 @@ class ZoomAccountAvailability extends BaseResolver { start_at: topic.start_at, end_at: topic.end_at, }, - excludeTopics: [topic.id], + excludeEvents: [topic.id], }); } diff --git a/api/services/ZoomAccount/index.js b/api/services/ZoomAccount/index.js index bbdf2d9..f04cc13 100644 --- a/api/services/ZoomAccount/index.js +++ b/api/services/ZoomAccount/index.js @@ -1,5 +1,4 @@ import Models from 'Models'; -import DataLoader from 'dataloader'; import BaseModelService, { saveInstance, requireInstance, @@ -20,20 +19,6 @@ export default class ZoomAccount extends BaseModelService { return !data; } - static async findAllAvailabilityDuring(keys) { - const { id, dateTimeRange, ...options } = keys[0]; - return Models.ZoomAccount.findAll({ - where: { - id: { - [Models.Sequelize.Op.in]: keys.map(({ id }) => id), - }, - }, - ...utilizedResourceClause(dateTimeRange, options), - }).then((accounts) => - keys.map((key) => !accounts.find((account) => key.id === account.id)), - ); - } - static getAvailabilityLoader = Availability.loader(); @requireInstance