fixed links on books relations
This commit is contained in:
@@ -202,7 +202,7 @@ function renderRelations(edges) {
|
|||||||
const el = document.createElement('div');
|
const el = document.createElement('div');
|
||||||
el.className = 'relation-card-horizontal';
|
el.className = 'relation-card-horizontal';
|
||||||
|
|
||||||
const img = node.coverImage?.large || node.coverImage?.medium || '/public/assets/no-image.png';
|
const img = node.coverImage?.large || node.coverImage?.medium || '/public/assets/placeholder.svg';
|
||||||
const title = node.title?.romaji || node.title?.english || node.title?.native || 'Unknown';
|
const title = node.title?.romaji || node.title?.english || node.title?.native || 'Unknown';
|
||||||
const type = edge.relationType ? edge.relationType.replace(/_/g, ' ') : 'Related';
|
const type = edge.relationType ? edge.relationType.replace(/_/g, ' ') : 'Related';
|
||||||
|
|
||||||
@@ -215,7 +215,8 @@ function renderRelations(edges) {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
el.onclick = () => {
|
el.onclick = () => {
|
||||||
const targetType = node.type === 'ANIME' ? 'anime' : 'book';
|
const imgUrl = node.coverImage?.medium || '';
|
||||||
|
const targetType = imgUrl.includes('/manga/') ? 'book' : 'anime';
|
||||||
window.location.href = `/${targetType}/${node.id}`;
|
window.location.href = `/${targetType}/${node.id}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ function renderRelations(edges) {
|
|||||||
const el = document.createElement('div');
|
const el = document.createElement('div');
|
||||||
el.className = 'relation-card-horizontal';
|
el.className = 'relation-card-horizontal';
|
||||||
|
|
||||||
const img = node.coverImage?.large || node.coverImage?.medium || '/public/assets/no-image.png';
|
const img = node.coverImage?.large || node.coverImage?.medium || '/public/assets/placeholder.svg';
|
||||||
const title = node.title?.romaji || node.title?.english || node.title?.native || 'Unknown';
|
const title = node.title?.romaji || node.title?.english || node.title?.native || 'Unknown';
|
||||||
const type = edge.relationType ? edge.relationType.replace(/_/g, ' ') : 'Related';
|
const type = edge.relationType ? edge.relationType.replace(/_/g, ' ') : 'Related';
|
||||||
|
|
||||||
@@ -215,7 +215,8 @@ function renderRelations(edges) {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
el.onclick = () => {
|
el.onclick = () => {
|
||||||
const targetType = node.type === 'ANIME' ? 'anime' : 'book';
|
const imgUrl = node.coverImage?.medium || '';
|
||||||
|
const targetType = imgUrl.includes('/manga/') ? 'book' : 'anime';
|
||||||
window.location.href = `/${targetType}/${node.id}`;
|
window.location.href = `/${targetType}/${node.id}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user