From f2b06293da49dd23ba7703a99bb1ce70de85b6c0 Mon Sep 17 00:00:00 2001 From: shani Date: Sun, 19 May 2024 17:39:28 +0700 Subject: [PATCH] feat: fix create medical record --- src/handler/patient_handler.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/handler/patient_handler.go b/src/handler/patient_handler.go index 4b259ea..497717c 100644 --- a/src/handler/patient_handler.go +++ b/src/handler/patient_handler.go @@ -105,13 +105,8 @@ func (h *PatientHandler) CreateRecord(c *gin.Context) { } //error 404 - filter := dto.RequestGetRecord{ - IdentityDetail: dto.IdentityDetail{ - IdentityNumber: request.IdentityNumber, - }, - } - exist, _ := h.iPatientUsecase.GetRecords(filter) - if len(exist) == 0 || err != nil { + exist, _ := h.iPatientUsecase.GetPatientByIdentityNumber(request.IdentityNumber) + if (!exist) { log.Println("Create request is not exist >> GetRecords") c.JSON(404, gin.H{"status": "not exist", "message": "IdentityNumber not exist"}) return