remove unnecessary await

This commit is contained in:
Eduardo Quiros 2022-08-23 21:51:43 -06:00
parent d0d1d6e396
commit 842ec2d04d
No known key found for this signature in database
GPG Key ID: B77F36C3F12720B4
1 changed files with 9 additions and 9 deletions

View File

@ -72,7 +72,7 @@ export class UsersService {
); );
} }
async resetUserPassword(user: UserDocument){ async resetUserPassword(user: UserDocument) {
let passwordEncriptada = Md5.init(user.password); let passwordEncriptada = Md5.init(user.password);
user.password = passwordEncriptada; user.password = passwordEncriptada;
return this.userModel.findOneAndUpdate({ _id: user._id }, { password: passwordEncriptada }, { return this.userModel.findOneAndUpdate({ _id: user._id }, { password: passwordEncriptada }, {
@ -84,7 +84,7 @@ export class UsersService {
const pattern = { cmd: 'findOneCommunity' } const pattern = { cmd: 'findOneCommunity' }
const payload = { _id: community_id } const payload = { _id: community_id }
let callback = await this.clientCommunityApp let callback = this.clientCommunityApp
.send<string>(pattern, payload) .send<string>(pattern, payload)
.pipe( .pipe(
map((response: string) => ({ response })) map((response: string) => ({ response }))
@ -114,8 +114,8 @@ export class UsersService {
async updateAdminSystem(id: string, user: UserDocument) { async updateAdminSystem(id: string, user: UserDocument) {
return this.userModel.findOneAndUpdate({ _id: id }, { return this.userModel.findOneAndUpdate({ _id: id }, {
name: user['name'], last_name: user['last_name'], name: user['name'], last_name: user['last_name'],
dni:user['dni'], email: user['email'], phone: user['phone'] dni: user['dni'], email: user['email'], phone: user['phone']
}, { }, {
new: true, new: true,
}); });
} }
@ -212,7 +212,7 @@ export class UsersService {
} }
async deleteAdminSystem(id: string) { async deleteAdminSystem(id: string) {
return this.userModel.findOneAndUpdate({ _id: id }, { status: '-1'}, { return this.userModel.findOneAndUpdate({ _id: id }, { status: '-1' }, {
new: true, new: true,
}); });
} }
@ -225,13 +225,13 @@ export class UsersService {
async deleteTenant(tenant_id: string, community_id: string, number_house: string) { async deleteTenant(tenant_id: string, community_id: string, number_house: string) {
try{ try {
await this.userModel.findOneAndUpdate({ _id: tenant_id }, { status: '-1', number_house:''}, { await this.userModel.findOneAndUpdate({ _id: tenant_id }, { status: '-1', number_house: '' }, {
new: true, new: true,
}); });
return await this.deleteTenantNumHouse(community_id, number_house, tenant_id); return await this.deleteTenantNumHouse(community_id, number_house, tenant_id);
} catch(error){ } catch (error) {
console.log(error) console.log(error)
return error; return error;
} }