feat: add set status membership endpoint
This commit is contained in:
@@ -261,6 +261,22 @@ export class UsersService {
|
||||
return userData;
|
||||
}
|
||||
|
||||
setStatus = async (id: string, type: string) => {
|
||||
const userData = new User();
|
||||
|
||||
if (type === 'active') {
|
||||
userData.isActive = true;
|
||||
} else {
|
||||
userData.isActive = false;
|
||||
}
|
||||
|
||||
await this.connection.transaction(async (manager) => {
|
||||
await manager.update(User, { id: id }, userData);
|
||||
});
|
||||
|
||||
return userData;
|
||||
};
|
||||
|
||||
async remove(id: string) {
|
||||
try {
|
||||
await this.usersRepository.findOneOrFail(id);
|
||||
|
||||
Reference in New Issue
Block a user