From 023fd879f9bad4b1cee2aa6b2fff5172cd90664b Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 18 Jan 2025 09:30:43 -0800 Subject: [PATCH] Use party.id to query embed image instead of shortcode The API doesn't understand shortcodes as indexes --- components/party/PartyHead/index.tsx | 2 +- utils/api.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/party/PartyHead/index.tsx b/components/party/PartyHead/index.tsx index 22c3dc15..a471c5bb 100644 --- a/components/party/PartyHead/index.tsx +++ b/components/party/PartyHead/index.tsx @@ -19,7 +19,7 @@ const PartyHead = ({ party, meta }: Props) => { const router = useRouter() const locale = router.locale && ['en', 'ja'].includes(router.locale) ? router.locale : 'en' - const previewUrl = api.previewUrl(party.shortcode) + const previewUrl = api.previewUrl(party.id) return ( diff --git a/utils/api.tsx b/utils/api.tsx index 892212b5..8508e197 100644 --- a/utils/api.tsx +++ b/utils/api.tsx @@ -139,8 +139,8 @@ class Api { return axios.get(resourceUrl, params) } - previewUrl(shortcode: string): string { - return `${this.url}/parties/${shortcode}/preview` + previewUrl(id: string): string { + return `${this.url}/parties/${id}/preview` } raidGroups(params?: {}) {