feat: migrate from paths constant to new route management system

This commit is contained in:
Sonny
2024-05-16 18:53:53 +02:00
committed by Sonny
parent 905f0ba1c7
commit 57ed2c5e94
20 changed files with 82 additions and 75 deletions

View File

@@ -1,6 +1,7 @@
import PATHS from '#constants/paths';
import Collection from '#models/collection';
import Link from '#models/link';
import { route } from '@izzyjs/route/client';
import { appendCollectionId } from '~/lib/navigation';
import { SearchItem, SearchResult } from '~/types/search';
export function buildSearchItem(
@@ -13,7 +14,7 @@ export function buildSearchItem(
url:
type === 'link'
? (item as Link).url
: `${PATHS.DASHBOARD}?collectionId=${item.id}`,
: appendCollectionId(route('dashboard').url, item.id),
type,
collection: type === 'link' ? (item as Link).collection : undefined,
};