Use same lock values as mobile clients
[ProtonMail-WebClient.git] / packages / shared / lib / api / drive / folder.ts
blob226250f5aae67e330a9aa120251e836cb280e072
1 import { SORT_DIRECTION } from '../../constants';
2 import { DEFAULT_SORT_FIELD, DEFAULT_SORT_ORDER, FOLDER_PAGE_SIZE } from '../../drive/constants';
3 import type { CreateNewFolder } from '../../interfaces/drive/folder';
5 export const queryFolderChildren = (
6     shareID: string,
7     linkID: string,
8     {
9         Page,
10         PageSize = FOLDER_PAGE_SIZE,
11         FoldersOnly = 0,
12         Sort = DEFAULT_SORT_FIELD,
13         Desc = DEFAULT_SORT_ORDER === SORT_DIRECTION.ASC ? 0 : 1,
14     }: { Page: number; PageSize?: number; FoldersOnly?: number; Sort?: string; Desc?: 0 | 1 }
15 ) => ({
16     method: 'get',
17     url: `drive/shares/${shareID}/folders/${linkID}/children`,
18     params: { Page, PageSize, FoldersOnly, Sort, Desc, Thumbnails: 1 },
19 });
21 export const queryCreateFolder = (shareID: string, data: CreateNewFolder) => ({
22     method: 'post',
23     url: `drive/shares/${shareID}/folders`,
24     data,
25 });