From 480b9d85f17e0c8a3d0175f9a18e12fbe54ac10d Mon Sep 17 00:00:00 2001 From: ingalls Date: Tue, 1 Oct 2024 12:01:37 -0400 Subject: [PATCH] Fix lints --- api/lib/control/tilejson.ts | 2 +- api/routes/basemap.ts | 4 ++-- api/test/basemap.srv.test.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/lib/control/tilejson.ts b/api/lib/control/tilejson.ts index 8902f1212..3e49a409f 100644 --- a/api/lib/control/tilejson.ts +++ b/api/lib/control/tilejson.ts @@ -58,7 +58,7 @@ export default class TileJSON { try { url = new URL(str); } catch (err) { - throw new Err(400, err, 'Invalid URL provided'); + throw new Err(400, err instanceof Error ? err : new Error(String(err)), 'Invalid URL provided'); } if (!['http:', 'https:'].includes(url.protocol)) { diff --git a/api/routes/basemap.ts b/api/routes/basemap.ts index 383e6dd1c..b2f5e5292 100644 --- a/api/routes/basemap.ts +++ b/api/routes/basemap.ts @@ -86,8 +86,8 @@ export default async function router(schema: Schema, config: Config) { try { const b = await BasemapParser.parse(String(buffer)); - if (!b.basemap.customMapSource) return res.json(imported); - const map = b.basemap.customMapSource; + if (!b.raw.customMapSource) return res.json(imported); + const map = b.raw.customMapSource; imported.name = map.name._text; imported.minzoom = map.minZoom._text; diff --git a/api/test/basemap.srv.test.ts b/api/test/basemap.srv.test.ts index a5c2ea038..ab8621dde 100644 --- a/api/test/basemap.srv.test.ts +++ b/api/test/basemap.srv.test.ts @@ -212,7 +212,7 @@ test('PATCH: api/basemap/1 - Invalid URL', async (t) => { test('DELETE: api/basemap/1', async (t) => { try { - await flight.fetch('/api/basemap/1', { + const res = await flight.fetch('/api/basemap/1', { method: 'DELETE', auth: { bearer: flight.token.admin