From f1fe0e0bc4cf651cb46daf163a110457a6339969 Mon Sep 17 00:00:00 2001 From: vinix Date: Thu, 9 Oct 2025 22:51:27 +0700 Subject: [PATCH] filter hide superadmin from get all user --- src/api/user.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/user.jsx b/src/api/user.jsx index 5812dd7..c7d8b35 100644 --- a/src/api/user.jsx +++ b/src/api/user.jsx @@ -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 {