From 833c97e7cd1114701afc788ac349192d9888640d Mon Sep 17 00:00:00 2001 From: Chiquita Ahsanunnisa <16521248@mahasiswa.itb.ac.id> Date: Wed, 1 May 2024 15:46:13 +0700 Subject: [PATCH] refactor: remove useless roles --- src/entities/pengguna.entity.ts | 3 --- src/helper/validation.ts | 17 ----------------- 2 files changed, 20 deletions(-) delete mode 100644 src/helper/validation.ts diff --git a/src/entities/pengguna.entity.ts b/src/entities/pengguna.entity.ts index da7a922..e1d014a 100644 --- a/src/entities/pengguna.entity.ts +++ b/src/entities/pengguna.entity.ts @@ -9,17 +9,14 @@ import { PendaftaranTesis } from "./pendaftaranTesis.entity"; export enum RoleEnum { ADMIN = "ADMIN", - TU = "TU", S2_MAHASISWA = "S2_MAHASISWA", S2_PEMBIMBING = "S2_PEMBIMBING", S2_PENGUJI = "S2_PENGUJI", S2_TIM_TESIS = "S2_TIM_TESIS", - S2_KULIAH = "S2_KULIAH", S1_MAHASISWA = "S1_MAHASISWA", S1_PEMBIMBING = "S1_PEMBIMBING", S1_PENGUJI = "S1_PENGUJI", S1_TIM_TA = "S1_TIM_TA", - S1_KULIAH = "S1_KULIAH", } @Entity() diff --git a/src/helper/validation.ts b/src/helper/validation.ts deleted file mode 100644 index cfc65eb..0000000 --- a/src/helper/validation.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NotFoundException } from "@nestjs/common"; -import { validate as uuidValidate } from "uuid"; - -interface ID { - id: string; - object: string; -} - -export function validateId(items: ID[]) { - for (const item of items) { - const isValidUUID = uuidValidate(item.id); - - if (!isValidUUID) { - throw new NotFoundException(`${item.object} not found.`); - } - } -} -- GitLab