From 25c9b779e4d19bc34551f8b137266a459e0d70e1 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Fri, 29 Mar 2024 10:43:30 -0400 Subject: [PATCH] fix: map theme auth in shared links (#8359) fix: map theme auth --- mobile/openapi/doc/SystemConfigApi.md | Bin 10073 -> 10159 bytes mobile/openapi/lib/api/system_config_api.dart | Bin 7925 -> 8112 bytes .../openapi/test/system_config_api_test.dart | Bin 1133 -> 1149 bytes open-api/immich-openapi-specs.json | 8 ++++++++ open-api/typescript-sdk/src/fetch-client.ts | 4 +++- .../shared-components/map/map.svelte | 3 ++- 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mobile/openapi/doc/SystemConfigApi.md b/mobile/openapi/doc/SystemConfigApi.md index e782265b421728b358fc81c6bacfb91a15607154..2d1ce0da60f52f63989554c780a73b7327ba0988 100644 GIT binary patch delta 125 zcmccVx88rleF0V-h3wSI%?ISQSSE9dN-Cvg<|XEUgcNK+WPEBxVs1fBs17tx|YH8Id0J+im1tppJKx1Pk NPgE7(Tq*WI003XUDck@6 delta 41 zcmV+^0M`GnPuWhe-w?CP7$gLf2o)cb?i?zUcNGqkKMq=x0Vc}!B9S(q~!0oSGrOaK4? delta 16 Xcmey%@s?x5E2hbLOj4Ugm@^pxJ_rTq diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 0bd6524db4..a2aae92c41 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -5348,6 +5348,14 @@ "get": { "operationId": "getMapStyle", "parameters": [ + { + "name": "key", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + }, { "name": "theme", "required": true, diff --git a/open-api/typescript-sdk/src/fetch-client.ts b/open-api/typescript-sdk/src/fetch-client.ts index 00794f1208..b9b4978a9b 100644 --- a/open-api/typescript-sdk/src/fetch-client.ts +++ b/open-api/typescript-sdk/src/fetch-client.ts @@ -2422,13 +2422,15 @@ export function getConfigDefaults(opts?: Oazapfts.RequestOpts) { ...opts })); } -export function getMapStyle({ theme }: { +export function getMapStyle({ key, theme }: { + key?: string; theme: MapTheme; }, opts?: Oazapfts.RequestOpts) { return oazapfts.ok(oazapfts.fetchJson<{ status: 200; data: object; }>(`/system-config/map/style.json${QS.query(QS.explode({ + key, theme }))}`, { ...opts diff --git a/web/src/lib/components/shared-components/map/map.svelte b/web/src/lib/components/shared-components/map/map.svelte index 74643e502f..b42cf66498 100644 --- a/web/src/lib/components/shared-components/map/map.svelte +++ b/web/src/lib/components/shared-components/map/map.svelte @@ -2,7 +2,7 @@ import Icon from '$lib/components/elements/icon.svelte'; import { Theme } from '$lib/constants'; import { colorTheme, mapSettings } from '$lib/stores/preferences.store'; - import { getAssetThumbnailUrl, handlePromiseError } from '$lib/utils'; + import { getAssetThumbnailUrl, getKey, handlePromiseError } from '$lib/utils'; import { getMapStyle, MapTheme, type MapMarkerResponseDto } from '@immich/sdk'; import { mdiCog, mdiMapMarker } from '@mdi/js'; import type { Feature, GeoJsonProperties, Geometry, Point } from 'geojson'; @@ -50,6 +50,7 @@ $: style = (() => getMapStyle({ theme: ($mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT) as unknown as MapTheme, + key: getKey(), }) as Promise)(); const dispatch = createEventDispatcher<{