www.spaceplanner.app

Web client to the spaceplanner API
git clone git://jacobedwards.org/www.spaceplanner.app
Log | Files | Refs

commit 1e8fdf249beaee2e40577ffacc53255890f371d5
parent 0201ea023def966afa5d56e5b2c376e683e50f3a
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Fri, 23 Aug 2024 14:37:47 -0700

Ensure pointmap point ids are numbers in addPointmap

Diffstat:
Mfiles/floorplans/floorplan/backend.js | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/files/floorplans/floorplan/backend.js b/files/floorplans/floorplan/backend.js @@ -460,6 +460,9 @@ export class FloorplanBackend { throw new Error("Pointmap must reference existing points") } + a = Number(a) + b = Number(b) + // NOTE: For now, a and b are numbers. May not always be the case return this.addData("pointmaps", { type: type, @@ -523,13 +526,8 @@ export class FloorplanBackend { op = "replace" } } - patch.push( { op: op, path: dirty[i].path, value: dirty[i].value }) - let ref = parsePath(dirty[i].path) - if (ref.type === "pointmaps") { - dirty[i].value.a = Number(dirty[i].value.a) - dirty[i].value.b = Number(dirty[i].value.b) - } + patch.push( { op: op, path: dirty[i].path, value: dirty[i].value }) } console.debug("Backend.push (patch)", patch)