diff --git a/src/controllers/employee-other-info-controller.ts b/src/controllers/employee-other-info-controller.ts index 58e0ff5..3cb6284 100644 --- a/src/controllers/employee-other-info-controller.ts +++ b/src/controllers/employee-other-info-controller.ts @@ -38,23 +38,12 @@ type EmployeeOtherInfoPayload = { export class EmployeeOtherInfo extends Controller { @Get() async list(@Path() employeeId: string) { - return prisma.employeeOtherInfo.findMany({ + return prisma.employeeOtherInfo.findFirst({ orderBy: { createdAt: "asc" }, where: { employeeId }, }); } - @Get("{otherInfoId}") - async getById(@Path() employeeId: string, @Path() otherInfoId: string) { - const record = await prisma.employeeOtherInfo.findFirst({ - where: { id: otherInfoId, employeeId }, - }); - if (!record) { - throw new HttpError(HttpStatus.NOT_FOUND, "Employee info cannot be found.", "data_not_found"); - } - return record; - } - @Post() async create( @Request() req: RequestWithUser,