feat: more property added in userInputDto and key updated
This commit is contained in:
@@ -2,6 +2,20 @@ import { Field, InputType } from '@nestjs/graphql';
|
|||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
export class UpdateUserInput {
|
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({
|
@Field({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
name: 'currentRESTSession',
|
name: 'currentRESTSession',
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export class UserResolver {
|
|||||||
@UseGuards(GqlAuthGuard)
|
@UseGuards(GqlAuthGuard)
|
||||||
async updateUser(
|
async updateUser(
|
||||||
@GqlUser() user: User,
|
@GqlUser() user: User,
|
||||||
@Args('userInput') userInput: UpdateUserInput,
|
@Args('user') userInput: UpdateUserInput,
|
||||||
): Promise<User> {
|
): Promise<User> {
|
||||||
const updatedUser = await this.userService.updateUser(user, userInput);
|
const updatedUser = await this.userService.updateUser(user, userInput);
|
||||||
if (E.isLeft(updatedUser)) throwErr(updatedUser.left);
|
if (E.isLeft(updatedUser)) throwErr(updatedUser.left);
|
||||||
|
|||||||
Reference in New Issue
Block a user