mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
cross-search shows joined data, but is not formatted nor does check user rights
This commit is contained in:
@@ -14,7 +14,7 @@ router.get('/all', async (req, res) => {
|
||||
const crossSearch = await getAllCrossSearch(req.user)
|
||||
console.log(crossSearch[2])
|
||||
console.log(crossSearch[2]?.now_ls[0].com_species)
|
||||
return res.status(200).send(fixBigInt(localities))
|
||||
return res.status(200).send(fixBigInt(crossSearch))
|
||||
})
|
||||
|
||||
router.get('/:id', async (req, res) => {
|
||||
|
||||
Vendored
+1
@@ -91,6 +91,7 @@ export type CrossSearch = {
|
||||
country: string | null
|
||||
loc_status: boolean | null
|
||||
species: list | null
|
||||
now_ls: list | null
|
||||
}
|
||||
|
||||
export type Sequence = Prisma.now_tu_sequence
|
||||
|
||||
@@ -36,9 +36,14 @@ export const CrossSearchTable = ({ selectorFn }: { selectorFn?: (newObject: Cros
|
||||
filterVariant: 'range',
|
||||
},
|
||||
{
|
||||
accessorKey: 'species',
|
||||
header: 'Species',
|
||||
formatter: (species: any) => species.map((s: any) => s.species_name).join(', '),
|
||||
accessorFn: row => row.now_ls.map((item: any) => item.com_species.species_id),
|
||||
id: 'species_id',
|
||||
header: 'Species IDs',
|
||||
},
|
||||
{
|
||||
accessorFn: row => row.now_ls.map((item: any) => item.com_species.genus_name),
|
||||
id: 'genus_name',
|
||||
header: 'Genus',
|
||||
}
|
||||
],
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user