chore: changed updateShortcode method name to updateEmbedProperties

This commit is contained in:
Balu Babu
2023-11-07 17:48:27 +05:30
parent 23bb9bc3d1
commit 877f210ad7
3 changed files with 8 additions and 8 deletions

View File

@@ -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,

View File

@@ -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"}',

View File

@@ -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,