fix
This commit is contained in:
parent
e6539edaec
commit
52e0141de4
3 changed files with 52 additions and 14 deletions
|
|
@ -33,6 +33,7 @@ import {
|
|||
import { AppDataSource } from "../database/data-source";
|
||||
import { Profile } from "../entities/Profile";
|
||||
import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||
import { IsNull } from "typeorm";
|
||||
// import * as io from "../lib/websocket";
|
||||
// import elasticsearch from "../elasticsearch";
|
||||
// import { StorageFolder } from "../interfaces/storage-fs";
|
||||
|
|
@ -184,6 +185,17 @@ export class KeycloakController extends Controller {
|
|||
async deleteUser(@Path() userId: string) {
|
||||
const result = await deleteUser(userId);
|
||||
if (!result) throw new Error("Failed. Cannot delete userId.");
|
||||
|
||||
const profile = await this.profileRepo.findOne({
|
||||
where: {
|
||||
id: userId,
|
||||
},
|
||||
});
|
||||
|
||||
if (profile) {
|
||||
profile.keycloak = "";
|
||||
await this.profileRepo.save(profile);
|
||||
}
|
||||
}
|
||||
// @Security("bearerAuth", ["system", "admin"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue