From 3e3bab28d2fe7497b2fb39134db52c8e07f83c85 Mon Sep 17 00:00:00 2001 From: Balu Babu Date: Tue, 5 Dec 2023 18:19:25 +0530 Subject: [PATCH] chore: completed changes requested in PR review --- .../src/team-collection/team-collection.service.ts | 14 ++++++++++---- .../src/types/CollectionFolder.ts | 1 + .../src/user-collection/user-collection.service.ts | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts b/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts index 13c337e3f..734e9e679 100644 --- a/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts +++ b/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts @@ -201,8 +201,11 @@ export class TeamCollectionService { ), ); - teamCollections.forEach((x) => - this.pubsub.publish(`team_coll/${destTeamID}/coll_added`, this.cast(x)), + teamCollections.forEach((collection) => + this.pubsub.publish( + `team_coll/${destTeamID}/coll_added`, + this.cast(collection), + ), ); return E.right(true); @@ -271,8 +274,11 @@ export class TeamCollectionService { ), ); - teamCollections.forEach((x) => - this.pubsub.publish(`team_coll/${destTeamID}/coll_added`, this.cast(x)), + teamCollections.forEach((collections) => + this.pubsub.publish( + `team_coll/${destTeamID}/coll_added`, + this.cast(collections), + ), ); return E.right(true); diff --git a/packages/hoppscotch-backend/src/types/CollectionFolder.ts b/packages/hoppscotch-backend/src/types/CollectionFolder.ts index 572ed9ad3..990a22b55 100644 --- a/packages/hoppscotch-backend/src/types/CollectionFolder.ts +++ b/packages/hoppscotch-backend/src/types/CollectionFolder.ts @@ -1,3 +1,4 @@ +// This interface defines how data will be received from the app when we are importing Hoppscotch collections export interface CollectionFolder { id?: string; folders: CollectionFolder[]; diff --git a/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts b/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts index 45d61bbc8..06128e0fd 100644 --- a/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts +++ b/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts @@ -1079,8 +1079,8 @@ export class UserCollectionService { ), ); - userCollections.forEach((x) => - this.pubsub.publish(`user_coll/${userID}/created`, this.cast(x)), + userCollections.forEach((collection) => + this.pubsub.publish(`user_coll/${userID}/created`, this.cast(collection)), ); return E.right(true);