From 733f7d2bd7d2b943cb77a3954a8c82d3695e6a40 Mon Sep 17 00:00:00 2001 From: Tobi Abiodun Date: Sun, 10 Nov 2024 17:57:02 -0500 Subject: [PATCH] feat(AdminGodMode.vue): (#1293) - import 'moment' for date manipulation - add date filter to API request for the last 30 days - include 'organization' and 'files' fields in user details API request --- src/pages/admin/AdminGodMode.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/admin/AdminGodMode.vue b/src/pages/admin/AdminGodMode.vue index e661bd1f5..19246e8e7 100644 --- a/src/pages/admin/AdminGodMode.vue +++ b/src/pages/admin/AdminGodMode.vue @@ -5,6 +5,7 @@ import { getUserLocationLayer, mapTileLayer } from '@/utils/map'; import User from '@/models/User'; import * as L from 'leaflet'; import { momentFromNow } from '@/filters'; +import moment from 'moment'; interface UserGeoLocation { user: string; @@ -27,6 +28,8 @@ const getAllUserLocations = async () => { { params: { limit: 1000, + // only in the last 30 days + updated_at__gte: moment().subtract(30, 'days').toISOString(), }, }, ); @@ -103,7 +106,7 @@ onMounted(async () => { for (let i = 0; i < userIds.length; i += chunkSize) { promises.push( User.api().get( - `/users?id__in=${userIds.slice(i, i + chunkSize).join(',')}&fields=id,first_name,last_name,email,mobile`, + `/users?id__in=${userIds.slice(i, i + chunkSize).join(',')}&fields=id,first_name,last_name,email,mobile,organization,files`, { dataKey: 'results', },