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}")
|
@Delete("user/{userId}")
|
||||||
@Security("bearerAuth", ["system", "admin"])
|
|
||||||
async deleteUser(@Path() userId: string) {
|
async deleteUser(@Path() userId: string) {
|
||||||
return await deleteUser(userId).then(async (v) => {
|
const result = await deleteUser(userId);
|
||||||
if (!v) throw new Error("ไม่สามารถติดต่อกับระบบจัดการผู้ใช้งานได้");
|
if (!result) throw new Error("Failed. Cannot delete userId.");
|
||||||
// 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 + "/" });
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
// @Security("bearerAuth", ["system", "admin"])
|
||||||
|
|
||||||
|
|
||||||
@Get("role")
|
@Get("role")
|
||||||
async getRole() {
|
async getRole() {
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,6 @@ export async function getUserList(search = "") {
|
||||||
return Boolean(console.error("Keycloak Error Response: ", await res.json()));
|
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>) => ({
|
return ((await res.json()) as any[]).map((v: Record<string, string>) => ({
|
||||||
id: v.id,
|
id: v.id,
|
||||||
username: v.username,
|
username: v.username,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue