mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 23:15:36 +00:00
feat: migrate from paths constant to new route management system
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user