feat(cms): Add CMS table with delete and edit functionality

- Implement CMS table with row listing and pagination
- Add delete functionality for CMS entries with confirmation modal
- Introduce edit button to navigate to edit page for specific CMS entry
- Update page type form to include new 'key' field for CMS entries
- Modify CMS service and types to support new data structure
- Enhance table presenter with additional actions and state management
Resolves data management and user interaction improvements for CMS module
This commit is contained in:
AmirReza Jamali
2025-11-11 10:12:21 +03:30
parent 2b9eaa0495
commit b444f6a08f
7 changed files with 178 additions and 11 deletions
+8
View File
@@ -28,4 +28,12 @@ export const cmsService = {
throw error;
}
},
deleteCms: async (id: string) => {
try {
return (await api.delete(API_ENDPOINTS.CMS.BASE(id))).data;
} catch (error) {
console.error("Error caught in CMS Service => delete CMS: ", error);
throw error;
}
},
};
+2 -1
View File
@@ -155,6 +155,7 @@ export const cmsListResponseSchema = z.object({
export const cmsDetailsResponse = z.object({
cms: CmsSchema,
});
export type TCms = z.infer<typeof CmsSchema>;
export type TCmsListResponse = z.infer<typeof cmsListResponseSchema>;
export type TCmsDetailsResponse = z.infer<typeof cmsDetailsResponse>
export type TCmsDetailsResponse = z.infer<typeof cmsDetailsResponse>;
export type TCmsCredentials = z.infer<typeof CmsCredentials>;