Implement dark theme and comprehensive profile settings with working functionality
This commit is contained in:
@ -36,4 +36,22 @@ export class UsersResolver {
|
||||
) {
|
||||
return this.usersService.update(user.id, { bio, avatar });
|
||||
}
|
||||
|
||||
@Mutation(() => User)
|
||||
@UseGuards(GqlAuthGuard)
|
||||
updateProfile(
|
||||
@CurrentUser() user: User,
|
||||
@Args('bio') bio: string,
|
||||
) {
|
||||
return this.usersService.update(user.id, { bio });
|
||||
}
|
||||
|
||||
@Mutation(() => User)
|
||||
@UseGuards(GqlAuthGuard)
|
||||
updateOnlineStatus(
|
||||
@CurrentUser() user: User,
|
||||
@Args('isOnline') isOnline: boolean,
|
||||
) {
|
||||
return this.usersService.updateOnlineStatus(user.id, isOnline);
|
||||
}
|
||||
}
|
@ -55,10 +55,11 @@ export class UsersService {
|
||||
return this.findOne(id);
|
||||
}
|
||||
|
||||
async updateOnlineStatus(id: string, isOnline: boolean): Promise<void> {
|
||||
async updateOnlineStatus(id: string, isOnline: boolean): Promise<User> {
|
||||
await this.usersRepository.update(id, {
|
||||
isOnline,
|
||||
lastSeen: isOnline ? undefined : new Date(),
|
||||
});
|
||||
return this.findOne(id);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user