aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-10-06 16:56:38 -0500
committerJP Dillingham <jp@dillingham.me>2024-10-06 16:56:38 -0500
commite5659ce50fe1344f5ccf7229482ba450193e389a (patch)
treed522b31eaa8c1b4f448b8aeedc4eb4df570356b7
parent8d919e494ef53fbdf625540971414d26c06a96fb (diff)
downloadslskd-e5659ce50fe1344f5ccf7229482ba450193e389a.tar.gz
retrieve total count from header
-rw-r--r--src/web/src/lib/events.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/web/src/lib/events.js b/src/web/src/lib/events.js
index 5c349a08..9f16a66f 100644
--- a/src/web/src/lib/events.js
+++ b/src/web/src/lib/events.js
@@ -1,7 +1,10 @@
import api from './api';
export const list = async ({ offset, limit }) => {
- const response = (await api.get(`/events?offset=${offset}&limit=${limit}`))
- .data;
- return response;
+ const response = await api.get(`/events?offset=${offset}&limit=${limit}`);
+
+ const events = response.data;
+ const totalCount = response.headers['x-total-count'];
+
+ return { events, totalCount };
};