feat(breadcrumb): build breadcrumb in 1 API call
add /api/folders/{id}/ancestors
this API to iterate parent up to the drive root or the shared folder
this will help UI to build the breadcrumb in 1 API call
and to identify the root element (is it a drive users has access to or
a shared folder ?)
ui: now only 1 API call is now required to build the breadcrumb
This commit is contained in:
@@ -61,6 +61,13 @@ vi.mock('$lib/api/endpoints/folders', () => ({
|
||||
folderZipUrl: () => '/zip',
|
||||
getFolder: vi.fn(async (id: string) => ({ id, name: id })),
|
||||
getFolderName: () => undefined,
|
||||
// Consumed by the new shared `<FolderBreadcrumb>` component that
|
||||
// `/files` mounts. Return an empty chain so the breadcrumb renders
|
||||
// nothing — tests here don't assert on breadcrumb content.
|
||||
getFolderAncestors: vi.fn(async (id: string) => ({
|
||||
ancestors: [{ id, name: id, parent_id: null, drive_id: 'test-drive' }],
|
||||
access_source: { kind: 'drive' as const }
|
||||
})),
|
||||
invalidateFolderCache: vi.fn(),
|
||||
moveFolder: vi.fn(),
|
||||
rememberFolderName: vi.fn(),
|
||||
|
||||
Reference in New Issue
Block a user