Skip to content

Commit

Permalink
[accel-web] docs for sortUrl()
Browse files Browse the repository at this point in the history
  • Loading branch information
koyopro committed Jan 6, 2025
1 parent 37daca4 commit 5745339
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/accel-web/src/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ import { Search } from "accel-record/search";

export type Direction = "asc" | "desc";

/**
* Generates a URL for sorting based on the provided search query and sorting options.
*
* @param q - The search query object.
* @param key - The primary key to sort by.
* @param options - Optional sorting options.
* @param options.defaultOrder - The default sorting order if not specified (default is "asc").
* @param options.keys - An array of keys to sort by, each key can include a direction (e.g., "name desc").
* @param options.request - An optional request object containing the URL to update.
* @returns URL with the sorting parameters.
*/
export const sortUrl = (
q: Search<any>,
key: string,
Expand Down

0 comments on commit 5745339

Please sign in to comment.