feat: introducing shortcode into admin module (#3504)
* feat: added query in infra to fetch all shortcodes * feat: added mutation in admin to delete shortcode * chore: added new tests for methods in shortcode module * chore: removed .vscode file * chore: added a new ShortcodeCreator type to output of fetchAllShortcodes query * chore: shortcodeCreator type is now nullable * chore: added type defs to fetchAllShortcodes method in admin module * docs: update code comments * chore: changed target to prod in hoppscotch-old-backend --------- Co-authored-by: Mir Arif Hasan <arif.ishan05@gmail.com>
This commit is contained in:
@@ -443,6 +443,23 @@ export class AdminResolver {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Mutation(() => Boolean, {
|
||||
description: 'Revoke Shortcode by ID',
|
||||
})
|
||||
@UseGuards(GqlAuthGuard, GqlAdminGuard)
|
||||
async revokeShortcodeByAdmin(
|
||||
@Args({
|
||||
name: 'code',
|
||||
description: 'The shortcode to delete',
|
||||
type: () => ID,
|
||||
})
|
||||
code: string,
|
||||
): Promise<boolean> {
|
||||
const res = await this.adminService.deleteShortcode(code);
|
||||
if (E.isLeft(res)) throwErr(res.left);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Subscriptions */
|
||||
|
||||
@Subscription(() => InvitedUser, {
|
||||
|
||||
Reference in New Issue
Block a user