Skip to content

Commit

Permalink
Fix #431 Update data attribute is returns empty response
Browse files Browse the repository at this point in the history
  • Loading branch information
albinpa authored and georgepadayatti committed Nov 1, 2023
1 parent 40fccce commit 69136bf
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ func validateReq(dataAttributeReq updateDataAttributeReq, organisationId string)

func updateDataAttributeFromReq(dataAttributeId string, requestBody updateDataAttributeReq, dataAttributes []dataagreement.DataAttribute) ([]dataagreement.DataAttribute, int) {
updatedDataAttributes := make([]dataagreement.DataAttribute, len(dataAttributes))
updatedDataAttributes = dataAttributes

for i, dataAttribute := range dataAttributes {
if dataAttribute.Id.Hex() == dataAttributeId {
dataAttributes[i].Name = requestBody.DataAttribute.Name
dataAttributes[i].Description = requestBody.DataAttribute.Description
dataAttributes[i].Sensitivity = requestBody.DataAttribute.Sensitivity
dataAttributes[i].Category = requestBody.DataAttribute.Category
updatedDataAttributes[i].Name = requestBody.DataAttribute.Name
updatedDataAttributes[i].Description = requestBody.DataAttribute.Description
updatedDataAttributes[i].Sensitivity = requestBody.DataAttribute.Sensitivity
updatedDataAttributes[i].Category = requestBody.DataAttribute.Category

return updatedDataAttributes, i
}
Expand Down

0 comments on commit 69136bf

Please sign in to comment.