Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1x 1x 1x 1x 1x 1x 1x 1x 1x | import { queryFetchPackageById } from '@/entities/package'
import { getIdFromIRI } from '@/shared/helpers'
import { Pipe } from '@/entities/pipe'
export const getQueriesForPackage = (pipes?: Pipe[]) => {
return (
pipes
?.filter(pipe => pipe.package)
.filter((pipe, index, self) => self.findIndex(t => t.package?.['@id'] === pipe.package?.['@id']) === index)
.map(pipe => ({
queryFn: () => queryFetchPackageById(getIdFromIRI(pipe?.package?.['@id']) as string)()(),
})) || []
)
}
|