From f9de546d1462b0380c173d9e2f5766677e348a42 Mon Sep 17 00:00:00 2001 From: Mir Arif Hasan Date: Thu, 22 Dec 2022 18:56:18 +0600 Subject: [PATCH] feat: more property added in userInputDto and key updated --- .../src/user/dtos/update-user-input.dto.ts | 14 ++++++++++++++ .../hoppscotch-backend/src/user/user.resolver.ts | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-backend/src/user/dtos/update-user-input.dto.ts b/packages/hoppscotch-backend/src/user/dtos/update-user-input.dto.ts index 2747c9e3d..41bd3e9ec 100644 --- a/packages/hoppscotch-backend/src/user/dtos/update-user-input.dto.ts +++ b/packages/hoppscotch-backend/src/user/dtos/update-user-input.dto.ts @@ -2,6 +2,20 @@ import { Field, InputType } from '@nestjs/graphql'; @InputType() export class UpdateUserInput { + @Field({ + nullable: true, + name: 'displayName', + description: 'Displayed name of the user (if given)', + }) + displayName?: string; + + @Field({ + nullable: true, + name: 'photoURL', + description: 'URL to the profile photo of the user (if given)', + }) + photoURL?: string; + @Field({ nullable: true, name: 'currentRESTSession', diff --git a/packages/hoppscotch-backend/src/user/user.resolver.ts b/packages/hoppscotch-backend/src/user/user.resolver.ts index 3358b187b..99475d0d5 100644 --- a/packages/hoppscotch-backend/src/user/user.resolver.ts +++ b/packages/hoppscotch-backend/src/user/user.resolver.ts @@ -44,7 +44,7 @@ export class UserResolver { @UseGuards(GqlAuthGuard) async updateUser( @GqlUser() user: User, - @Args('userInput') userInput: UpdateUserInput, + @Args('user') userInput: UpdateUserInput, ): Promise { const updatedUser = await this.userService.updateUser(user, userInput); if (E.isLeft(updatedUser)) throwErr(updatedUser.left);