@@ -2,7 +2,7 @@ import { FunctionComponent } from "react";
2
2
import Link from "next/link" ;
3
3
4
4
import ReferenceLinks from "../common/ReferenceLinks" ;
5
- import { getPath } from "../../utils/dataAccess" ;
5
+ import { getItemPath } from "../../utils/dataAccess" ;
6
6
import { { { { ucf } } } } from '../../types/{{{ucf}}}' ;
7
7
8
8
interface Props {
@@ -35,18 +35,18 @@ export const List: FunctionComponent<Props> = ({ {{{lc}}}s }) => (
35
35
{ { { lc} } } [ '@id' ] & &
36
36
< tr className = "py-2" key = { { { { lc} } } [ '@id' ] } >
37
37
< 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' ] } } / >
39
39
</th >
40
40
{ { #each fields} }
41
41
< td >
42
42
{ { #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 } ) ) } / >
44
44
{ { 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}}}' ] } } / >
46
46
{ { 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' ] } ) ) } / >
48
48
{ { 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' ] } } / >
50
50
{ { else if ( compare type "==" "Date" ) } }
51
51
{ { { { . . / lc} } } [ '{{{name}}}' ] ?. toLocaleString( ) }
52
52
{ { else} }
@@ -56,7 +56,7 @@ export const List: FunctionComponent<Props> = ({ {{{lc}}}s }) => (
56
56
{ { / each } }
57
57
< td className = "w-8" >
58
58
< Link
59
- href = { getPath ( { { { lc} } } [ '@id' ] , '/{{{lc}}}s/[id]' ) }
59
+ href = { getItemPath ( { { { lc} } } [ '@id' ] , '/{{{lc}}}s/[id]' ) }
60
60
className = "text-cyan-500"
61
61
>
62
62
Show
@@ -68,7 +68,7 @@ export const List: FunctionComponent<Props> = ({ {{{lc}}}s }) => (
68
68
< / t d >
69
69
< td className = "w-8" >
70
70
< Link
71
- href = { getPath ( { { { lc} } } [ "@id" ] , '/{{{lc}}}s/[id]/edit' ) }
71
+ href = { getItemPath ( { { { lc} } } [ "@id" ] , '/{{{lc}}}s/[id]/edit' ) }
72
72
className = "text-cyan-500"
73
73
>
74
74
Edit
0 commit comments