Merge branch 'nice' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-05-29 14:20:58 +07:00
commit f65efbd42e
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() {

View file

@ -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,