From 2628d1745b148953a6477a76ab4dc1bc224032da Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 18 Jan 2025 09:30:59 -0800 Subject: [PATCH] Use party.id to query embed image instead of shortcode (#422) 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?: {}) {