apps/api: update: return updated account
This commit is contained in:
parent
0643080e68
commit
7ac3f0cc6a
@ -46,7 +46,9 @@ export class AccountService {
|
||||
throw new BadRequestException(`Prop ${field} is not allowed`);
|
||||
});
|
||||
|
||||
return this.accountModel.findOneAndUpdate({ username }, props).exec();
|
||||
this.accountModel.findOneAndUpdate({ username }, props).exec();
|
||||
|
||||
return this.accountModel.findOne({ username });
|
||||
}
|
||||
|
||||
public async login({ login, password }: Credentials) {
|
||||
@ -75,7 +77,7 @@ export class AccountService {
|
||||
try {
|
||||
const { username } = this.jwtService.verify(token) as TokenPayload;
|
||||
|
||||
return this.accountModel.find({
|
||||
return this.accountModel.findOne({
|
||||
username,
|
||||
});
|
||||
} catch {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user