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:
@@ -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;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user