aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/locations.js3
-rw-r--r--routes/users.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/routes/locations.js b/routes/locations.js
index fb4487f7..0f71fde9 100644
--- a/routes/locations.js
+++ b/routes/locations.js
@@ -2,6 +2,7 @@ import { g } from "$lib/db";
export default {
async list(req, res) {
- res.send({ locations: await g("locations") });
+ let locations = await g("locations");
+ res.send({ locations });
}
};
diff --git a/routes/users.js b/routes/users.js
index 158a61b1..2867e53a 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -187,7 +187,7 @@ export default {
if (user.pin && !(pin === user.pin)) throw new Error("Pin required");
if (typeof newpin !== "undefined" && newpin.length === 6) user.pin = newpin;
- if (!user.pin || user.pin === "undefined") delete user.pin;
+ if (user.pin === "delete") delete user.pin;
let exists;
if (username) exists = await getUser(username);