filter hide superadmin from get all user

This commit is contained in:
2025-10-09 22:51:27 +07:00
parent c6957b46c6
commit f1fe0e0bc4

View File

@@ -13,14 +13,17 @@ const getAllUser = async (queryParams) => {
// Backend returns all data, so we need to do client-side pagination
const allData = response.data || [];
const totalData = allData.length;
// Filter out users with is_sa = true
const filteredData = allData.filter(user => user.is_sa !== true);
const totalData = filteredData.length;
// Calculate start and end index for current page
const startIndex = (currentPage - 1) * currentLimit;
const endIndex = startIndex + currentLimit;
// Slice data for current page
const paginatedData = allData.slice(startIndex, endIndex);
const paginatedData = filteredData.slice(startIndex, endIndex);
// Transform response to match TableList expected structure
return {