Merge branch 'nice' into develop
This commit is contained in:
commit
f65efbd42e
2 changed files with 4 additions and 31 deletions
|
|
@ -129,37 +129,12 @@ export class KeycloakController extends Controller {
|
|||
}
|
||||
|
||||
@Delete("user/{userId}")
|
||||
@Security("bearerAuth", ["system", "admin"])
|
||||
async deleteUser(@Path() userId: string) {
|
||||
return await deleteUser(userId).then(async (v) => {
|
||||
if (!v) throw new Error("ไม่สามารถติดต่อกับระบบจัดการผู้ใช้งานได้");
|
||||
// await elasticsearch.deleteByQuery({
|
||||
// index: DEFAULT_INDEX,
|
||||
// query: {
|
||||
// bool: {
|
||||
// must: [
|
||||
// { prefix: { pathname: stripLeadingSlash(`${userId}/`) } },
|
||||
// { match: { type: "folder" } },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
// delete file that is not uploaded
|
||||
// await elasticsearch.deleteByQuery({
|
||||
// index: DEFAULT_INDEX,
|
||||
// query: {
|
||||
// bool: {
|
||||
// must: [
|
||||
// { prefix: { pathname: stripLeadingSlash(`${userId}/`) } },
|
||||
// { match: { upload: false } },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
|
||||
// io.getInstance()?.emit("FolderDelete", { pathname: userId + "/" });
|
||||
});
|
||||
const result = await deleteUser(userId);
|
||||
if (!result) throw new Error("Failed. Cannot delete userId.");
|
||||
}
|
||||
// @Security("bearerAuth", ["system", "admin"])
|
||||
|
||||
|
||||
@Get("role")
|
||||
async getRole() {
|
||||
|
|
|
|||
|
|
@ -139,8 +139,6 @@ export async function getUserList(search = "") {
|
|||
return Boolean(console.error("Keycloak Error Response: ", await res.json()));
|
||||
}
|
||||
|
||||
console.log(res.json);
|
||||
|
||||
return ((await res.json()) as any[]).map((v: Record<string, string>) => ({
|
||||
id: v.id,
|
||||
username: v.username,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue