This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-05-29 14:20:37 +07:00
parent 7c1bcebcb8
commit 2fb1f4f841
2 changed files with 4 additions and 31 deletions

View file

@ -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() {