chore: changed updateShortcode method name to updateEmbedProperties
This commit is contained in:
@@ -88,7 +88,7 @@ export class ShortcodeResolver {
|
|||||||
description: 'Update a user generated Shortcode',
|
description: 'Update a user generated Shortcode',
|
||||||
})
|
})
|
||||||
@UseGuards(GqlAuthGuard)
|
@UseGuards(GqlAuthGuard)
|
||||||
async updateShortcode(
|
async updateEmbedProperties(
|
||||||
@GqlUser() user: AuthUser,
|
@GqlUser() user: AuthUser,
|
||||||
@Args({
|
@Args({
|
||||||
name: 'code',
|
name: 'code',
|
||||||
@@ -102,7 +102,7 @@ export class ShortcodeResolver {
|
|||||||
})
|
})
|
||||||
properties: string,
|
properties: string,
|
||||||
) {
|
) {
|
||||||
const result = await this.shortcodeService.updateShortcode(
|
const result = await this.shortcodeService.updateEmbedProperties(
|
||||||
code,
|
code,
|
||||||
user.uid,
|
user.uid,
|
||||||
properties,
|
properties,
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ describe('ShortcodeService', () => {
|
|||||||
|
|
||||||
describe('updateShortcode', () => {
|
describe('updateShortcode', () => {
|
||||||
test('should return SHORTCODE_PROPERTIES_NOT_FOUND error when updatedProps in invalid', async () => {
|
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,
|
mockEmbed.id,
|
||||||
user.uid,
|
user.uid,
|
||||||
'',
|
'',
|
||||||
@@ -381,7 +381,7 @@ describe('ShortcodeService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should return SHORTCODE_PROPERTIES_NOT_FOUND error when updatedProps in invalid JSON format', async () => {
|
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,
|
mockEmbed.id,
|
||||||
user.uid,
|
user.uid,
|
||||||
'{kk',
|
'{kk',
|
||||||
@@ -391,7 +391,7 @@ describe('ShortcodeService', () => {
|
|||||||
|
|
||||||
test('should return SHORTCODE_NOT_FOUND error when Shortcode ID is invalid', async () => {
|
test('should return SHORTCODE_NOT_FOUND error when Shortcode ID is invalid', async () => {
|
||||||
mockPrisma.shortcode.update.mockRejectedValue('RecordNotFound');
|
mockPrisma.shortcode.update.mockRejectedValue('RecordNotFound');
|
||||||
const result = await shortcodeService.updateShortcode(
|
const result = await shortcodeService.updateEmbedProperties(
|
||||||
'invalidID',
|
'invalidID',
|
||||||
user.uid,
|
user.uid,
|
||||||
'{}',
|
'{}',
|
||||||
@@ -405,7 +405,7 @@ describe('ShortcodeService', () => {
|
|||||||
embedProperties: '{"foo":"bar"}',
|
embedProperties: '{"foo":"bar"}',
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await shortcodeService.updateShortcode(
|
const result = await shortcodeService.updateEmbedProperties(
|
||||||
mockEmbed.id,
|
mockEmbed.id,
|
||||||
user.uid,
|
user.uid,
|
||||||
'{"foo":"bar"}',
|
'{"foo":"bar"}',
|
||||||
@@ -424,7 +424,7 @@ describe('ShortcodeService', () => {
|
|||||||
embedProperties: '{"foo":"bar"}',
|
embedProperties: '{"foo":"bar"}',
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await shortcodeService.updateShortcode(
|
const result = await shortcodeService.updateEmbedProperties(
|
||||||
mockEmbed.id,
|
mockEmbed.id,
|
||||||
user.uid,
|
user.uid,
|
||||||
'{"foo":"bar"}',
|
'{"foo":"bar"}',
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ export class ShortcodeService implements UserDataHandler, OnModuleInit {
|
|||||||
* @param uid User Uid
|
* @param uid User Uid
|
||||||
* @returns Updated Shortcode
|
* @returns Updated Shortcode
|
||||||
*/
|
*/
|
||||||
async updateShortcode(
|
async updateEmbedProperties(
|
||||||
shortcodeID: string,
|
shortcodeID: string,
|
||||||
uid: string,
|
uid: string,
|
||||||
updatedProps: string,
|
updatedProps: string,
|
||||||
|
|||||||
Reference in New Issue
Block a user