1) I would *not *avoid that. We use the protection and have no problem at 
all with it.
2) Create a filter and use it in beforeSave()? Create data objects like the 
entities in Cake and filter the date there before sending?
3) No idea what you're talking about, you basically say "It's not working 
righ". We do the transformRequest just once AFAIR.
4) No idea, "It's not working" is nothing you'll get help with.

See 
http://book.cakephp.org/3.0/en/development/routing.html#creating-restful-routes 
There is also the FoC CRUD plugin but we don't use it yet and probably 
won't. Cake is good enough as it is for us so far. We're re-building our 
frontend and a CRM with Angular and Cake3.

On Wednesday, March 9, 2016 at 3:04:19 PM UTC+1, Rafael Queiroz wrote:
>
> Hi guys,
>
> I make a *API* using *CakePHP 3.2.x*, so, and now have a angular app 
> requesting *API*.
> My question is about association data, e.g. i have *Series* *Model* and 
> send the request:
>
> *api.com/series/add <http://api.com/series/add>*
>
> {
>     "id": 5,
>     "title": "New serie", 
>     "hidden": false,
>     "courses": {"_ids":["1","2"]}
> }
>
> It's work, many times, i have problems, because first time in edit, i get 
> register and mockup in scope of app, and have problems, because register 
> have all fields, per sample: 
>
> 1. Avoiding Mass Assignment Protection in Entity, because save created = 
> null
> 2. Send all object data, have association data i don't want send, i need 
> using transformRequest in angularJs
> 3. Many times i have problem with CORS, because send a object complex, not 
> expected, if simple object it's work
> 4. I have problem for delete association data, have a garbage in docs, but 
> not work's 100%. [1]
>
> So, this easy save data and associations, now, it's my nightmare.
>
> *My point is about best practices for api, i read articles and have a 
> solution, using sub resources.*
>
>
>
> *I need create new endpoints for retrieve/save/delete associations data in 
> register ?What do you think ? Thank you in advance for your attention*
> [1] 
> http://book.cakephp.org/3.0/en/orm/saving-data.html#patching-hasmany-and-belongstomany
>
> -- 
> Regards,
>
> Rafael F. Queiroz
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to