serializeSort
function serializeSort(input): string;Defined in: filters/sort.ts:71
Serialize the model back to the compact query form (field:dir, comma
separated) — the inverse of parseSortParam.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ sort: Sort; } |
input.sort |
Sort |
Returns
Section titled “Returns”string
Example
Section titled “Example”import { serializeSort } from "@xtandard/lib/filters";
serializeSort({ sort: [ { field: "createdAt", dir: "desc" }, { field: "name", dir: "asc" }, ],}); // → "createdAt:desc,name:asc"serializeSort({ sort: [] }); // → ""