EDMdesigner / editor-issues

This is an issue tracking repository for reporting bugs, improvements and feature requests of our email editor.
5 stars 1 forks source link

"No projectId given!!" for /json/project/updateInfo #33

Closed danieledler closed 8 years ago

danieledler commented 8 years ago

I'm trying to update the title for a project but I get the response

{ "err": "No projectId given!!" }

In the docs, you have required parameter field data of type Project, where the Project model has an _id field. So I tried sending the data as

{
  _id: "5729c3528a95db2a23f9fc16",
  title: "My new title"
}

For the /json/project/createFromDefaults route, this works, but that route also has _id next to data as required parameters in the docs.

Looking at the JS API, the jsonp request doesn't call /jsonp/project/updateInfo as in the docs, but /jsonp/project/updateInfo/:projectId, so I also tried json/project/updateInfo/5729c3528a95db2a23f9fc16 but that resulted in a 404 response.

gyulanemeth commented 8 years ago

Hello,

well, these routes are weird a little bit. If you use JSONP, you should use /jsonp/project/updateInfo/:id but if you use the JSON, then you have to use /json/project/updateInfo and put a "projectId" field to the request. I know it's very ugly... It has historical reasons... :/

danieledler commented 8 years ago

Hi! Thanks, that works! (I tried combinations with projectId too, at least adding it in the url, but I must have missed setting it in the body.)