1
votes

I'm developing a SPA in angular with BreezeJS, I could configure the client to get the data from an typical RESTful API with no special support for Breeze capabilities (Metadata is writen by hand). Now I'm struggling to create/update entities, since my server endpoints expect a simple structure, but BreezeJS saveChanges sends an array like the one described in this question

What I need is to change the data my app sends to the server from this

// Current saveBundle
{"entities":  [
  { id:4, 
    label: "text",
    description: "longer text"..., 
    "entityAspect": {"entityTypeName": ...}},
]}

to this:

{ 
    id:4, 
    label: "text",
    description: "longer text"..., 
}

Is there a method or property I can override or something simple, I've been reading something about extending or writing my own dataservice adapter, but I'm lost in those waters. I'm thinking on putting some validations to parse that object from the API server in laravel, but that is not an easy way since there's a lot of code laid on already and the intention is to be generic so other clients (Breeze-less ones) consume the API. Thank you in advance

1

1 Answers

0
votes

Take a look at the Breeze REST Adapter for Azure Mobile or the Breeze REST Adapter for Sharepoint. You should be able to convert one of them to meet your needs.

See the Todo-Zumo sample to see how the adapter is used.