0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 Fixed links in History (#19551)

refs
https://linear.app/tryghost/issue/PROD-331/post-and-offer-links-404-in-history

- Links were using Ember route instead of absolute routes, causing 404s.
This commit is contained in:
Ronald Langeveld 2024-01-23 11:32:46 +00:00 committed by Steve Larson
parent 181be4ef1b
commit be619302df
2 changed files with 4 additions and 4 deletions

View file

@ -132,7 +132,7 @@ export const getLinkTarget = (action: Action): InternalLink | ExternalLink | und
return {
isExternal: true,
route: 'editor.edit',
route: `editor/${resourceType}/${action.resource.id}`,
models: [resourceType, action.resource.id]
};
case 'integration':
@ -145,10 +145,10 @@ export const getLinkTarget = (action: Action): InternalLink | ExternalLink | und
if (!action.resource || !action.resource.id) {
return;
}
// replace with Settings route once Offers X GA is released
return {
isExternal: true,
route: 'offer',
route: `offers/${action.resource.id}`,
models: [action.resource.id]
};
case 'tag':

View file

@ -131,7 +131,7 @@ const HistoryActionDescription: React.FC<{action: Action}> = ({action}) => {
const linkTarget = getLinkTarget(action);
if (linkTarget) {
return <a className='font-bold' href='#' onClick={(e) => {
return <a className='cursor-pointer font-bold' onClick={(e) => {
e.preventDefault();
updateRoute(linkTarget);
}}>{action.resource?.title || action.resource?.name}</a>;