mercredi 20 avril 2016

Promise error because of bad format

I created a new RestAdapter like so.

import DS from 'ember-data';

export default DS.RESTAdapter.extend({
  namespace: 'api',
  host: 'http://localhost:8081'
});

if i look at the network calls the api gets called properly and returns this data.

{
      "environments": [
        {
          "Id": 1,
          "LocalePath": "C:\\XML_DEPOT",
          "Name": "Acceptation 1",
          "RemotePath": "D:\\XML_DEPOT",
          "DatabaseServerName": "W050A01SQL1",
          "DatabaseName": "MAMROT01P1_MSCRM",
          "Port": 60903
        },
        {
          "Id": 2,
          "LocalePath": "bob",
          "Name": "Acceptation 2",
          "RemotePath": "bob",
          "DatabaseServerName": "W050A01SQL1\\W050A01SQL1B02",
          "DatabaseName": "MAMROT01P1_MSCRM",
          "Port": 60904
        }
    ]
}

and then i get an error saying that

Assertion Failed: normalizeResponse must return a valid JSON API document

but from what i understand the adapter is not a JSONAPIAdapter so it shouldnt try to serialize it has a jsonapi ??




Aucun commentaire:

Enregistrer un commentaire