Skip to content

Commit

Permalink
Merge pull request #1178 from didoda/fix/get-history-filter
Browse files Browse the repository at this point in the history
Fix objects history filter on no date
  • Loading branch information
didoda authored Sep 2, 2024
2 parents bb4d80c + 1586988 commit bc3d2ed
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ export default {
},
async getHistory(pageSize = 20, page = 1) {
const filterDate = this.filterDate ? new Date(this.filterDate).toISOString() : '';
const query = filterDate ? `page_size=${pageSize}&page=${page}&filter[created][gt]=${filterDate}&sort=-created` : `page_size=${pageSize}&page=${page}&sort=-created`;

return fetch(`/api/history?page_size=${pageSize}&page=${page}&filter[created][gt]=${filterDate}&sort=-created`).then((r) => r.json());
return fetch(`/api/history?${query}`).then((r) => r.json());
},
async getObjects(ids) {
return fetch(`/api/objects?filter[id]=${ids.join(',')}`).then((r) => r.json());
Expand Down

0 comments on commit bc3d2ed

Please sign in to comment.