Skip to content

Commit

Permalink
Fix #610 Fetch revisions by objectId and schemaName in service update…
Browse files Browse the repository at this point in the history
… dataagreement record
  • Loading branch information
albinpa authored and georgepadayatti committed Jan 9, 2024
1 parent 152a2ff commit d431de9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func ServiceUpdateDataAgreementRecord(w http.ResponseWriter, r *http.Request) {
return
}

currentDataAgreementRecordRevision, err := revision.GetLatestByObjectId(dataAgreementRecordId)
currentDataAgreementRecordRevision, err := revision.GetLatestByObjectIdAndSchemaName(dataAgreementRecordId, config.DataAgreementRecord)
if err != nil {
m := fmt.Sprintf("Failed to fetch latest revision for data agreement record: %v", dataAgreementRecordId)
common.HandleErrorV2(w, http.StatusInternalServerError, m, err)
Expand All @@ -107,7 +107,7 @@ func ServiceUpdateDataAgreementRecord(w http.ResponseWriter, r *http.Request) {
}
toBeUpdatedDaRecord.OptIn = dataAgreementRecordReq.OptIn

currentDataAgreementRevision, err := revision.GetLatestByObjectId(dataAgreementId)
currentDataAgreementRevision, err := revision.GetLatestByObjectIdAndSchemaName(dataAgreementId, config.DataAgreement)
if err != nil {
m := fmt.Sprintf("Failed to fetch latest revision for data agreement: %v", dataAgreementId)
common.HandleErrorV2(w, http.StatusInternalServerError, m, err)
Expand Down

0 comments on commit d431de9

Please sign in to comment.