Accession and Inventory numbers
The current code generates the full accession/inventory number by concatenating the parts of the number.
The two Link
components below are examples that illustrate the current approach.
export const AccessionLink = ({ accession }: { accession: Accession }): JSX.Element => (
<Link to={ `/a/${ accession.id }` }>
{ accession.accessionNumberPart1 } { ' ' }
{ accession.accessionNumberPart2 } { ' ' }
{ accession.accessionNumberPart3 }
</Link>
);
export const InventoryLink = ({ inventory }: { inventory: Inventory }): JSX.Element => (
<Link to={ `/inventory/${ inventory.id }` }>
{ inventory.inventoryNumberPart1 } { ' ' }
{ inventory.inventoryNumberPart2 } { ' ' }
{ inventory.inventoryNumberPart3 }
</Link>
);
The API returns the full Accession.accessionNumber
and Inventory.inventoryNumber
since commit 10bcc1a
and grin-global-server#96 (closed) will further enhance the formatting of accessionNumber
and inventoryNumber
.
Please update all instances where the full number is created from ..NumberPart1..4
to use accession.accessionNumber
or inventory.inventoryNumber
.