Skip to content

Support for meta object doesn't seem to work #36

@cedv

Description

@cedv

Support for meta object doesn't seem to work.

I tried with both store.sync and store.syncWithMeta, and either way, I can't see the meta information in the datastore when I pull the record using store.find. The rest of the data is fine; I can see the attributes, relationships and links.

This is how I use the datastore (within some AngularJS code):

var store = JsonApiDataStore.store;
store.sync(payload);
$scope.client = store.find('clients', 700);

And this is my JSON payload:

{
  "data": {
    "id": "700",
    "type": "clients",
    "links": {
      "self": "http://localhost:3000/clients/700"
    },
    "attributes": {
      "name": "Dummy Client"
    },
    "relationships": {
      "clientType": {
        "links": {
          "self": "http://localhost:3000/clients/700/relationships/client-type",
          "related": "http://localhost:3000/clients/700/client-type"
        },
        "data": {
          "type": "clientTypes",
          "id": "INTERNAL"
        }
      }
    },
    "meta": {
      "created": {
        "at": "1372275070780",
        "by": {
          "userName": "sys",
          "name": "System",
          "emailAddress": "system@example.com"
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions