From 877f210ad742750d4f37577e4f21b3de8b525b82 Mon Sep 17 00:00:00 2001 From: Balu Babu Date: Tue, 7 Nov 2023 17:48:27 +0530 Subject: [PATCH] chore: changed updateShortcode method name to updateEmbedProperties --- .../src/shortcode/shortcode.resolver.ts | 4 ++-- .../src/shortcode/shortcode.service.spec.ts | 10 +++++----- .../src/shortcode/shortcode.service.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/hoppscotch-backend/src/shortcode/shortcode.resolver.ts b/packages/hoppscotch-backend/src/shortcode/shortcode.resolver.ts index 6ecafba6f..df0158e1e 100644 --- a/packages/hoppscotch-backend/src/shortcode/shortcode.resolver.ts +++ b/packages/hoppscotch-backend/src/shortcode/shortcode.resolver.ts @@ -88,7 +88,7 @@ export class ShortcodeResolver { description: 'Update a user generated Shortcode', }) @UseGuards(GqlAuthGuard) - async updateShortcode( + async updateEmbedProperties( @GqlUser() user: AuthUser, @Args({ name: 'code', @@ -102,7 +102,7 @@ export class ShortcodeResolver { }) properties: string, ) { - const result = await this.shortcodeService.updateShortcode( + const result = await this.shortcodeService.updateEmbedProperties( code, user.uid, properties, diff --git a/packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts b/packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts index c84ddef7b..27ab9f5f1 100644 --- a/packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts +++ b/packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts @@ -372,7 +372,7 @@ describe('ShortcodeService', () => { describe('updateShortcode', () => { test('should return SHORTCODE_PROPERTIES_NOT_FOUND error when updatedProps in invalid', async () => { - const result = await shortcodeService.updateShortcode( + const result = await shortcodeService.updateEmbedProperties( mockEmbed.id, user.uid, '', @@ -381,7 +381,7 @@ describe('ShortcodeService', () => { }); test('should return SHORTCODE_PROPERTIES_NOT_FOUND error when updatedProps in invalid JSON format', async () => { - const result = await shortcodeService.updateShortcode( + const result = await shortcodeService.updateEmbedProperties( mockEmbed.id, user.uid, '{kk', @@ -391,7 +391,7 @@ describe('ShortcodeService', () => { test('should return SHORTCODE_NOT_FOUND error when Shortcode ID is invalid', async () => { mockPrisma.shortcode.update.mockRejectedValue('RecordNotFound'); - const result = await shortcodeService.updateShortcode( + const result = await shortcodeService.updateEmbedProperties( 'invalidID', user.uid, '{}', @@ -405,7 +405,7 @@ describe('ShortcodeService', () => { embedProperties: '{"foo":"bar"}', }); - const result = await shortcodeService.updateShortcode( + const result = await shortcodeService.updateEmbedProperties( mockEmbed.id, user.uid, '{"foo":"bar"}', @@ -424,7 +424,7 @@ describe('ShortcodeService', () => { embedProperties: '{"foo":"bar"}', }); - const result = await shortcodeService.updateShortcode( + const result = await shortcodeService.updateEmbedProperties( mockEmbed.id, user.uid, '{"foo":"bar"}', diff --git a/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts b/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts index 8c41a185c..cb6537239 100644 --- a/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts +++ b/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts @@ -229,7 +229,7 @@ export class ShortcodeService implements UserDataHandler, OnModuleInit { * @param uid User Uid * @returns Updated Shortcode */ - async updateShortcode( + async updateEmbedProperties( shortcodeID: string, uid: string, updatedProps: string,