Skip to content

Commit

Permalink
Expose offset and limit pagination params in browseRemoteFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Apr 30, 2024
1 parent 7ce6b10 commit cab0359
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/src/api/remoteFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@ export const remoteFilesFetcher = fetcher.path("/api/remote_files").method("get"
* @param uri The file source URI to browse.
* @param isRecursive Whether to recursively retrieve all files inside subdirectories.
* @param writeable Whether to return only entries that can be written to.
* @param limit The maximum number of entries to return.
* @param offset The number of entries to skip before returning the rest.
* @returns The list of files and directories from the server for the given URI.
*/
export async function browseRemoteFiles(uri: string, isRecursive = false, writeable = false): Promise<RemoteEntry[]> {
const { data } = await remoteFilesFetcher({ target: uri, recursive: isRecursive, writeable });
export async function browseRemoteFiles(
uri: string,
isRecursive = false,
writeable = false,
limit?: number,
offset?: number
): Promise<RemoteEntry[]> {
const { data } = await remoteFilesFetcher({ target: uri, recursive: isRecursive, writeable, limit, offset });
return data as RemoteEntry[];
}

Expand Down

0 comments on commit cab0359

Please sign in to comment.