Vuex ORM define id´s for objects inside properties

92 Views Asked by At

I get a response from an API looking like this:

{
    "error": null,
    "h": {
        "event": "EVENT",
        "date": 1621265337566,
        "edited": "me",
        "changed": [
            {
                "old": "",
                "new": "test",
                "field": "Name",
                "class": "form"
            }
        ]
    }
}

I am looking for a way to represent this in a Vuex ORM Model. In my understanding this should result in 3 Model Classes. One for the whole object, one for "h" and one for "changed". Vuex ORM provides methods to join these like hasMany but these seem to work with set id´s only which the api response does not provide.

Does anyone know how to represent this response in Vuex ORM ?

0

There are 0 best solutions below