diff options
| author | Adam Soltys <[email protected]> | 2025-03-28 11:01:06 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-03-28 11:01:29 -0700 |
| commit | 6793e625f3be380c10cbc7bfc08b30d7ce7dae5c (patch) | |
| tree | 667a324c7a44b6fea09cf0ae6d58dec6fd3724f6 /lib/locations.ts | |
| parent | 51fe575b9977fb787a3094237b83ee27dd3d03be (diff) | |
| download | coinos-server-6793e625f3be380c10cbc7bfc08b30d7ce7dae5c.tar.gz coinos-server-6793e625f3be380c10cbc7bfc08b30d7ce7dae5c.zip | |
use helper for location users
Diffstat (limited to 'lib/locations.ts')
| -rw-r--r-- | lib/locations.ts | 7 |
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; } } |
