From 0a7020613404b7f5476e4554a2781cc1faee8e15 Mon Sep 17 00:00:00 2001 From: Albin Antony Date: Fri, 5 Jan 2024 14:19:46 +0530 Subject: [PATCH] Fix #610 Fetch revisions by objectId and schemaName in service create draft consent record --- .../handler/v2/service/service_create_draft_consent_record.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)