FIWARE-TMForum / Business-API-Ecosystem

The FIWARE/TMForum Business API Ecosystem allows the monetization of different kind of assets (both digital and physical) during the whole service life cycle, from offering creation to its charging, accounting and revenue settlement and sharing
https://business-api-ecosystem.rtfd.io/
GNU Affero General Public License v3.0
39 stars 22 forks source link

Business addresses not being properly deleted #21

Closed samgh96 closed 6 years ago

samgh96 commented 6 years ago

When I create a business address of any kind and press the "delete" icon in Actions the PATCH response given is the same as the POST response of creation.

POST:

{
    "id": "idm_user",
    "href": "http://apis.docker:8080/DSPartyManagement/api/partyManagement/v2/individual/idm_user",
    "gender": "",
    "placeOfBirth": "",
    "countryOfBirth": "",
    "nationality": "",
    "maritalStatus": "",
    "birthDate": null,
    "title": "",
    "givenName": "idm",
    "familyName": "idm",
    "disability": [],
    "characteristic": [],
    "otherName": [],
    "individualIdentification": [],
    "externalReference": [],
    "relatedParty": [],
    "contactMedium": [
        {
            "type": "Email",
            "medium": {
                "emailAddress": "test@email.com"
            },
            "preferred": "false"
        }
    ]
}

PATCH (after pressing delete):

{
    "id": "idm_user",
    "href": "http://apis.docker:8080/DSPartyManagement/api/partyManagement/v2/individual/idm_user",
    "gender": "",
    "placeOfBirth": "",
    "countryOfBirth": "",
    "nationality": "",
    "maritalStatus": "",
    "birthDate": null,
    "title": "",
    "givenName": "idm",
    "familyName": "idm",
    "disability": [],
    "characteristic": [],
    "otherName": [],
    "individualIdentification": [],
    "externalReference": [],
    "relatedParty": [],
    "contactMedium": [
        {
            "type": "Email",
            "medium": {
                "emailAddress": "test@email.com"
            },
            "preferred": "false"
        }
    ]
}

But if I create multiple business addresses I can delete all but the last one I try to delete, and if I try to delete all and then post one the one I posted replaces the last one "deleted".

fdelavega commented 6 years ago

There were a bug in the party API which recognized the empty lists as if you have not included the field in the patch. It should be fixed now (you need to pull the develop tag of the APIs image)

samgh96 commented 6 years ago

Everything works fine now!