diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-08-25 18:32:14 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-08-25 18:32:14 -0400 |
| commit | 630c08b712a2ace833217428f1ef20bddc0b975d (patch) | |
| tree | 196f58ec99ace6e348148b6d5bc0408a11319fae /server/lib/api | |
| parent | a9bf197a6e8f91cc91d772238168d9be1beb3c4d (diff) | |
blueprint integration into project editor
Diffstat (limited to 'server/lib/api')
| -rw-r--r-- | server/lib/api/blueprint.js | 3 | ||||
| -rw-r--r-- | server/lib/api/projects.js | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/server/lib/api/blueprint.js b/server/lib/api/blueprint.js index e581d8f..222b466 100644 --- a/server/lib/api/blueprint.js +++ b/server/lib/api/blueprint.js @@ -92,6 +92,9 @@ var blueprint = { doc.name = util.sanitize(data.name) doc.slug = util.slugify(data.name) + doc.units = util.sanitize(data.units) + doc.viewHeight = util.sanitizeNumber(data.viewHeight) + doc.wallHeight = util.sanitizeNumber(data.wallHeight) doc.shapes = JSON.parse(data.shapes) doc.startPosition = JSON.parse(data.startPosition) diff --git a/server/lib/api/projects.js b/server/lib/api/projects.js index 3810168..50d3b49 100644 --- a/server/lib/api/projects.js +++ b/server/lib/api/projects.js @@ -37,7 +37,12 @@ var projects = { data.slug = util.slugify(data.name) + "-" + (+new Date) data.description = util.sanitize(data.description) data.viewHeight = Number(data.viewHeight || 0) - data.rooms = JSON.parse(data.rooms) + if (data.shapes) { + data.shapes = JSON.parse(data.shapes) + } + else { + data.rooms = JSON.parse(data.rooms) + } data.walls = JSON.parse(data.walls) data.media = JSON.parse(data.media) data.sculpture = JSON.parse(data.sculpture) @@ -102,7 +107,12 @@ var projects = { _.extend(doc, data) - doc.rooms = JSON.parse(data.rooms) + if (data.shapes) { + doc.shapes = JSON.parse(data.shapes) + } + else { + doc.rooms = JSON.parse(data.rooms) + } doc.walls = JSON.parse(data.walls) doc.colors = JSON.parse(data.colors) doc.media = JSON.parse(data.media) |
