Files
tm_panel/src/lib/api/services/contact-us-service.ts
T
AmirReza Jamali 88bc939956 feat(contact-us & feedback tables): implement pagination and loading states
- Added pagination functionality to ContactUsTable and FeedbackTable components, enhancing user navigation through large datasets.
- Integrated loading states to provide visual feedback during data fetching.
- Updated data fetching hooks to accept parameters for improved query handling.
- Refactored table row rendering to include pagination metadata for accurate row numbering.
- Enhanced overall user experience by conditionally rendering pagination controls based on data availability.
2026-05-11 17:30:34 +03:30

31 lines
826 B
TypeScript

import api from "../axios";
import { API_ENDPOINTS } from "../endpoints";
import { TContactApiResponseSchema } from "../types/TContacts";
export const contactUsService = {
getAllContactUs: async (
params?: Record<string, unknown>,
): Promise<TContactApiResponseSchema> => {
try {
return (await api.get(API_ENDPOINTS.CONTACT_US.BASE(), { params })).data;
} catch (error) {
console.error(
"ERROR caught in contact-us service => getAllContactUs",
error,
);
throw error;
}
},
deleteContactUs: async (id: string) => {
try {
return (await api.delete(API_ENDPOINTS.CONTACT_US.BASE(id))).data;
} catch (error) {
console.error(
"ERROR caught in contact-us service => deleteContactUs",
error,
);
throw error;
}
},
};