@@ -2,7 +2,7 @@ import { FunctionComponent } from "react";
22import Link from "next/link" ;
33
44import ReferenceLinks from "../common/ReferenceLinks" ;
5- import { getPath } from "../../utils/dataAccess" ;
5+ import { getItemPath } from "../../utils/dataAccess" ;
66import { { { { ucf } } } } from '../../types/{{{ucf}}}' ;
77
88interface Props {
@@ -35,18 +35,18 @@ export const List: FunctionComponent<Props> = ({ {{{lc}}}s }) => (
3535 { { { lc} } } [ '@id' ] & &
3636 < tr className = "py-2" key = { { { { lc} } } [ '@id' ] } >
3737 < th scope = "row" >
38- < ReferenceLinks items = { { href : getPath ( { { { lc} } } [ '@id' ] , '/{{{lc}}}s/[id]' ) , name : { { { lc} } } [ '@id' ] } } / >
38+ < ReferenceLinks items = { { href : getItemPath ( { { { lc} } } [ '@id' ] , '/{{{lc}}}s/[id]' ) , name : { { { lc} } } [ '@id' ] } } / >
3939 </th >
4040 { { #each fields} }
4141 < td >
4242 { { #if isReferences} }
43- < ReferenceLinks items = { { { { . . / lc} } } [ '{{{name}}}' ] . map ( ( ref : any ) => ( { href : getPath ( ref , '/{{{lowercase reference.title}}}s/[id]' ) , name : ref } ) ) } / >
43+ < ReferenceLinks items = { { { { . . / lc} } } [ '{{{name}}}' ] . map ( ( ref : any ) => ( { href : getItemPath ( ref , '/{{{lowercase reference.title}}}s/[id]' ) , name : ref } ) ) } / >
4444 { { else if reference} }
45- < ReferenceLinks items = { { href : getPath ( { { { . . / lc} } } [ '{{{name}}}' ] , '/{{{lowercase reference.title}}}s/[id]' ) , name : { { { . . / lc} } } [ '{{{name}}}' ] } } / >
45+ < ReferenceLinks items = { { href : getItemPath ( { { { . . / lc} } } [ '{{{name}}}' ] , '/{{{lowercase reference.title}}}s/[id]' ) , name : { { { . . / lc} } } [ '{{{name}}}' ] } } / >
4646 { { else if isEmbeddeds} }
47- < ReferenceLinks items = { { { { . . / lc} } } [ '{{{name}}}' ] . map ( ( emb : any ) => ( { href : getPath ( emb [ '@id' ] , '/{{{lowercase embedded.title}}}s/[id]' ) , name : emb [ '@id' ] } ) ) } / >
47+ < ReferenceLinks items = { { { { . . / lc} } } [ '{{{name}}}' ] . map ( ( emb : any ) => ( { href : getItemPath ( emb [ '@id' ] , '/{{{lowercase embedded.title}}}s/[id]' ) , name : emb [ '@id' ] } ) ) } / >
4848 { { else if embedded} }
49- < ReferenceLinks items = { { href : getPath ( { { { . . / lc} } } [ '{{{name}}}' ] [ '@id' ] , '/{{{lowercase embedded.title}}}s/[id]' ) , name : { { { . . / lc} } } [ '{{{name}}}' ] [ '@id' ] } } / >
49+ < ReferenceLinks items = { { href : getItemPath ( { { { . . / lc} } } [ '{{{name}}}' ] [ '@id' ] , '/{{{lowercase embedded.title}}}s/[id]' ) , name : { { { . . / lc} } } [ '{{{name}}}' ] [ '@id' ] } } / >
5050 { { else if ( compare type "==" "Date" ) } }
5151 { { { { . . / lc} } } [ '{{{name}}}' ] ?. toLocaleString( ) }
5252 { { else} }
@@ -56,7 +56,7 @@ export const List: FunctionComponent<Props> = ({ {{{lc}}}s }) => (
5656 { { / each } }
5757 < td className = "w-8" >
5858 < Link
59- href = { getPath ( { { { lc} } } [ '@id' ] , '/{{{lc}}}s/[id]' ) }
59+ href = { getItemPath ( { { { lc} } } [ '@id' ] , '/{{{lc}}}s/[id]' ) }
6060 className = "text-cyan-500"
6161 >
6262 Show
@@ -68,7 +68,7 @@ export const List: FunctionComponent<Props> = ({ {{{lc}}}s }) => (
6868 < / t d >
6969 < td className = "w-8" >
7070 < Link
71- href = { getPath ( { { { lc} } } [ "@id" ] , '/{{{lc}}}s/[id]/edit' ) }
71+ href = { getItemPath ( { { { lc} } } [ "@id" ] , '/{{{lc}}}s/[id]/edit' ) }
7272 className = "text-cyan-500"
7373 >
7474 Edit
0 commit comments