Skip to content
This repository has been archived by the owner on Mar 1, 2021. It is now read-only.

Commit

Permalink
solving edges not supporting date #162
Browse files Browse the repository at this point in the history
  • Loading branch information
ungentilgarcon committed Oct 27, 2017
1 parent 165069b commit ddef522
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion imports/endpoints/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,15 @@ Api.addCollection(Edges, {
post: {
authRequired: true,
action() {
const edges = this.bodyParams.edges
const topogramId = this.bodyParams.topogramId
const edges = this.bodyParams.edges
.map( n=> {
const { data } = n
if (data.start) data.start = new Date(n.data.start)
if (data.end) data.end = new Date(n.data.end)
return { data }
})

const data = createEdges( topogramId, edges )
return buildSuccessAnswer({ statusCode : 201, data })
}
Expand Down

0 comments on commit ddef522

Please sign in to comment.