Skip to content

Commit

Permalink
Merge pull request #11548 from wellcomecollection/fix-ex-text-link
Browse files Browse the repository at this point in the history
Revert change to link-resolver
  • Loading branch information
rcantin-w authored Jan 30, 2025
2 parents 242c611 + fefcb6d commit 66fbae7
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions common/services/prismic/link-resolver.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { isSiteSection, SiteSection } from '@weco/common/model/site-section';

import {
contentApiTypeMap,
isContentApiContentType,
isContentType,
} from './content-types';
import { isContentType } from './content-types';

type Props = {
uid?: string;
Expand All @@ -30,13 +26,7 @@ function linkResolver(doc: Props | DataProps): string {
// which doesn't necessarily have access to all data
if (!doc) return '/';

const { uid } = doc;

const type = isContentType(doc.type)
? doc.type
: isContentApiContentType(doc.type)
? contentApiTypeMap[doc.type]
: '';
const { uid, type } = doc;

if (!uid) return '/';
if (type === 'articles') return `/stories/${uid}`;
Expand All @@ -45,15 +35,12 @@ function linkResolver(doc: Props | DataProps): string {

if (
type === 'exhibition-guides' ||
type === 'exhibition-texts' ||
type === 'exhibition-highlight-tours' ||
type === 'exhibition-guides-links'
)
return `/guides/exhibitions/${uid}`;

if (type === 'exhibition-texts') {
return `/guides/exhibitions/${uid}/captions-and-transcripts`;
}

if (type === 'visual-stories') {
if ('data' in doc) {
const {
Expand Down

0 comments on commit 66fbae7

Please sign in to comment.