aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-03-28 11:01:06 -0700
committerAdam Soltys <[email protected]>2025-03-28 11:01:06 -0700
commit8f21a348ac0ee3827449f34d971559c1e59d0bcf (patch)
treed71c7f09ede7607e327559a0a9d79f69227aa58d /lib
parent173fadc3e3113f82533818665413a431c16ea3d6 (diff)
downloadcoinos-server-cln-rest.tar.gz
coinos-server-cln-rest.zip
use helper for location userscln-rest
Diffstat (limited to 'lib')
-rw-r--r--lib/locations.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/locations.ts b/lib/locations.ts
index 57658aad..660645a8 100644
--- a/lib/locations.ts
+++ b/lib/locations.ts
@@ -1,6 +1,6 @@
import { g, s } from "$lib/db";
import { err } from "$lib/logging";
-import { fields, pick } from "$lib/utils";
+import { fields, getUser } from "$lib/utils";
import got from "got";
const dedup = (array) =>
@@ -45,9 +45,8 @@ export const getLocations = async () => {
for await (const l of locations) {
const username = l.tags["payment:coinos"];
if (username) {
- const uid = await g(`user:${username}`);
- const user = await g(`user:${uid}`);
- if (user) l.osm_json.tags.user = pick(user, fields);
+ const user = await getUser(username, fields);
+ if (user) l.osm_json.tags.user = user;
}
}