Enable Sorting on Search By Created and Updated At (#140)

- Required updating query value to use first.value
  to set the value of the initial sort

- Ordering starts with name but can be changed to
  createdAt or updatedAt by the user
This commit is contained in:
Ryan Sheppard
2024-07-21 08:30:03 -05:00
committed by GitHub
parent 01f54aeb52
commit c9f31ef934
2 changed files with 20 additions and 1 deletions

View File

@@ -32,7 +32,7 @@ export function useRouteQuery(q: string, def: any): WritableComputedRef<any> {
case "string":
return computed({
get: () => {
const qv = route.query[q];
const qv = first.value;
if (Array.isArray(qv)) {
return qv[0];
}