fixed sorting by timestamp
This commit is contained in:
parent
43038cc576
commit
d74326aca2
3 changed files with 8 additions and 3 deletions
|
|
@ -31,7 +31,8 @@
|
|||
// Fetch actions for the current day from PocketBase
|
||||
const today = new Date().toISOString().split('T')[0];
|
||||
const result = await pb.collection('actions').getList<Action>(1, 50, {
|
||||
filter: `timestamp >= '${today}'`
|
||||
filter: `timestamp >= '${today}'`,
|
||||
sort: 'timestamp'
|
||||
});
|
||||
|
||||
// Assuming the items are in the 'items' property of the result
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ import { onMount } from 'svelte';
|
|||
|
||||
async function fetchAllActions() {
|
||||
// Fetch all actions. Adjust as needed for date range or pagination
|
||||
const result = await pb.collection('actions').getList(1, 1000);
|
||||
const result = await pb.collection('actions').getList(1, 1000,{
|
||||
sort: 'timestamp'
|
||||
});
|
||||
return result.items;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@
|
|||
|
||||
async function fetchAllActions() {
|
||||
// Fetch all actions. Adjust as needed for date range or pagination
|
||||
const result = await pb.collection('actions').getList(1, 1000);
|
||||
const result = await pb.collection('actions').getList(1, 1000, {
|
||||
sort: 'timestamp'
|
||||
});
|
||||
return result.items;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue