diff --git a/apps/web/src/components/user-tools/share/share-modal.tsx b/apps/web/src/components/user-tools/share/share-modal.tsx index 7d37478a4a..e7f1747a99 100644 --- a/apps/web/src/components/user-tools/share/share-modal.tsx +++ b/apps/web/src/components/user-tools/share/share-modal.tsx @@ -21,7 +21,6 @@ import { Instance } from '@/fetcher/graphql-types/operations' import { cn } from '@/helper/cn' import { colors } from '@/helper/colors' import { showToastNotice } from '@/helper/show-toast-notice' -import { serloDomain } from '@/helper/urls/serlo-domain' export interface ShareModalProps { isOpen: boolean @@ -39,11 +38,6 @@ interface EntryData { onClick?: (event: MouseEvent) => void } -const base = - process.env.NODE_ENV === 'development' - ? 'http://localhost:3000' - : 'https://' + serloDomain - export function ShareModal({ isOpen, setIsOpen, @@ -82,7 +76,7 @@ export function ShareModal({ async function copyContentToClipboard() { if (!pathOrId) return try { - const url = `${base}/api/frontend/bildungsraum-share?href=${encodeURIComponent(pathOrId)}` + const url = `/api/frontend/bildungsraum-share?href=${encodeURIComponent(pathOrId)}` const res = await fetch(url) const data = (await res.json()) as string if (!res.ok) { diff --git a/apps/web/src/pages/api/frontend/bildungsraum-share.ts b/apps/web/src/pages/api/frontend/bildungsraum-share.ts index dde1e97f4b..f39e3c7b2b 100644 --- a/apps/web/src/pages/api/frontend/bildungsraum-share.ts +++ b/apps/web/src/pages/api/frontend/bildungsraum-share.ts @@ -8,7 +8,7 @@ import { gql } from 'graphql-request' import type { NextApiRequest, NextApiResponse } from 'next' import { endpoint } from '@/api/endpoint' -import { InjectionOnlyContentQuery } from '@/fetcher/graphql-types/operations' +import { ShareEditorContentQuery } from '@/fetcher/graphql-types/operations' import { isProduction } from '@/helper/is-production' /** @@ -38,7 +38,7 @@ export default async function handler( body: JSON.stringify({ query, variables: { path } }), }) .then((res) => res.json()) - .then((data: { data: InjectionOnlyContentQuery }) => { + .then((data: { data: ShareEditorContentQuery }) => { if (!data.data?.uuid) { return res.status(404).json('not found') }