feat: more property added in userInputDto and key updated

This commit is contained in:
Mir Arif Hasan
2022-12-22 18:56:18 +06:00
parent 9e304b947b
commit f9de546d14
2 changed files with 15 additions and 1 deletions

View File

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

View File

@@ -44,7 +44,7 @@ export class UserResolver {
@UseGuards(GqlAuthGuard)
async updateUser(
@GqlUser() user: User,
@Args('userInput') userInput: UpdateUserInput,
@Args('user') userInput: UpdateUserInput,
): Promise<User> {
const updatedUser = await this.userService.updateUser(user, userInput);
if (E.isLeft(updatedUser)) throwErr(updatedUser.left);