The User Management panel gives platform administrators a complete view of every registered account on the Ad Management System. Accessible atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Priyanshu471/ad-management/llms.txt
Use this file to discover all available pages before exploring further.
/admin/users, the page fetches all users from the database and separates them into two tables — one for Advertisers and one for Creators — based on each account’s role field. A <Spinner /> is shown while data is loading to prevent a flash of empty content.
Route
Data Fetching
When the Users page mounts, it callsfetchUsers("/api/users") from the useFetchCamp Zustand store. The store issues a GET request to /api/users, retrieves the full user list from MongoDB via User.find({}), and then filters the results into two arrays before writing them into state:
advertisersData to one UsersTable instance and creatorsData to a second:
Loading State
WhilefetchUsers is in flight, the store sets loading: true. The page renders a full-screen centered <Spinner /> in place of both tables until the store resolves:
Table Columns
Both the Advertisers table and the Creators table share the same five-column structure, rendered by theUsersTable component:
| Column | Source |
|---|---|
| Name | user.name from the API response |
| Campaigns | Mock numeric array — not aggregated from the database |
user.email from the API response | |
| Member Since | Mock date strings — not derived from createdAt |
| Manage | MoreHorizontal icon — no action wired up yet |
Pagination
TheUsersTable component paginates its data at five rows per page. Page state is managed locally with useState, and the visible slice is recomputed in a useEffect that runs whenever the current page or the source data changes:
Pagination component is rendered below each table and controls the page state.
API Response Format
The/api/users endpoint returns the full users collection from MongoDB:
role field on each document drives the advertiser/creator split in the Zustand store. Valid values defined in the user schema are "advertiser", "creator", and "admin".
The Campaigns and Member Since columns currently display mock data. Campaign counts are not yet aggregated from the campaigns collection, and Member Since dates are not derived from the
createdAt timestamp returned by the API. The Manage column renders a MoreHorizontal icon but has no action connected to it in the current build.