Skip to content

Instantly share code, notes, and snippets.

@camilajenny
Created June 6, 2017 15:15
Show Gist options
  • Save camilajenny/30feaab530a6cb2bffbf459bb31c649e to your computer and use it in GitHub Desktop.
Save camilajenny/30feaab530a6cb2bffbf459bb31c649e to your computer and use it in GitHub Desktop.
db element from front
.post(upload.array(), function (req, res) {
let elem = new AnatomyElement();
let bodyElement = req.body.element;
elem.id = bodyElement.id;
elem.name = bodyElement.name;
elem.description = bodyElement.description;
elem.x = bodyElement.x;
elem.y = bodyElement.y;
elementService.createElement(elem);
res.send("post");
});
post(element: AnatomyElement): void {
this.http
.post(this.URL, { element })
//...
}
@camilajenny
Copy link
Author

te klamerki w { element } opakowuja JSONa i dlatego trzeba uzywac req.body.element zamist bezpośrednio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment