Created
June 6, 2017 15:15
-
-
Save camilajenny/30feaab530a6cb2bffbf459bb31c649e to your computer and use it in GitHub Desktop.
db element from front
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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"); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post(element: AnatomyElement): void { | |
this.http | |
.post(this.URL, { element }) | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
te klamerki w
{ element }
opakowuja JSONa i dlatego trzeba uzywacreq.body.element
zamist bezpośrednio