This commit is contained in:
Eduardo Quiros 2022-08-20 19:50:41 -06:00
parent 8dd3132ec4
commit c1106e7d63
No known key found for this signature in database
GPG Key ID: B77F36C3F12720B4
1 changed files with 20 additions and 19 deletions

View File

@ -14,8 +14,8 @@ export class UsersService {
@InjectModel(User.name) private readonly userModel: Model<UserDocument>, @InjectModel(User.name) private readonly userModel: Model<UserDocument>,
@Inject('SERVICIO_NOTIFICACIONES') private readonly clientNotificationtApp: ClientProxy, @Inject('SERVICIO_NOTIFICACIONES') private readonly clientNotificationtApp: ClientProxy,
@Inject('SERVICIO_COMUNIDADES') private readonly clientCommunityApp: ClientProxy, @Inject('SERVICIO_COMUNIDADES') private readonly clientCommunityApp: ClientProxy,
) { } ) { }
private publicKey: string; private publicKey: string;
async create(user: UserDocument): Promise<User> { async create(user: UserDocument): Promise<User> {
let passwordEncriptada = Md5.init(user.password); let passwordEncriptada = Md5.init(user.password);
@ -83,7 +83,7 @@ export class UsersService {
}*/ }*/
async remove(id: string) { async remove(id: string) {
return this.userModel.findOneAndUpdate({ _id: id }, {status: '-1'}, { return this.userModel.findOneAndUpdate({ _id: id }, { status: '-1' }, {
new: true, new: true,
}); });
} }
@ -104,7 +104,8 @@ export class UsersService {
resolve(res[0]); resolve(res[0]);
} else { } else {
resolve(null); resolve(null);
}}else{ }
} else {
resolve(null); resolve(null);
} }
} }
@ -183,14 +184,14 @@ 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,
}); });
} }
deleteAdminCommunity(id: string) { deleteAdminCommunity(id: string) {
return this.userModel.findOneAndUpdate({ _id: id }, {status: '-1'}, { return this.userModel.findOneAndUpdate({ _id: id }, { status: '-1' }, {
new: true, new: true,
}); });
} }
@ -234,7 +235,7 @@ export class UsersService {
} }
async changeStatus(id: string, status: string) { async changeStatus(id: string, status: string) {
return this.userModel.findOneAndUpdate({ _id: id }, {status: status}, { return this.userModel.findOneAndUpdate({ _id: id }, { status: status }, {
new: true, new: true,
}); });
} }