Skip to content

Commit

Permalink
feat(AdminGodMode.vue): (#1293)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
tabiodun authored Nov 10, 2024
1 parent de9eba8 commit 733f7d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/admin/AdminGodMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,6 +28,8 @@ const getAllUserLocations = async () => {
{
params: {
limit: 1000,
// only in the last 30 days
updated_at__gte: moment().subtract(30, 'days').toISOString(),
},
},
);
Expand Down Expand Up @@ -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',
},
Expand Down

0 comments on commit 733f7d2

Please sign in to comment.