diff --git a/internal/handler/v2/service/service_create_draft_consent_record.go b/internal/handler/v2/service/service_create_draft_consent_record.go index fa6f8ff..41922ec 100644 --- a/internal/handler/v2/service/service_create_draft_consent_record.go +++ b/internal/handler/v2/service/service_create_draft_consent_record.go @@ -69,7 +69,7 @@ func ServiceCreateDraftConsentRecord(w http.ResponseWriter, r *http.Request) { // If revision id is missing, fetch latest revision if err != nil && errors.Is(err, daRecord.RevisionIdIsMissingError) { - rev, err = revision.GetLatestByDataAgreementId(dataAgreementId) + rev, err = revision.GetLatestByObjectIdAndSchemaName(dataAgreementId, config.DataAgreement) if err != nil { m := fmt.Sprintf("Failed to fetch revision: %v", revisionId) common.HandleErrorV2(w, http.StatusInternalServerError, m, err)