refactor(marketing): Standardize marketing wizard steps with initial data support

- Add support for initial data in all marketing wizard step components
- Update step presenters to accept and handle initial data
- Modify forwardRef implementations to include initialData prop
- Add TypeScript interfaces for step component props
- Improve type safety and data handling across marketing wizard steps
- Prepare components for edit and create workflows with consistent data management
This commit is contained in:
AmirReza Jamali
2025-11-11 10:43:32 +03:30
parent b444f6a08f
commit bd79b7ed14
19 changed files with 842 additions and 688 deletions
+15 -1
View File
@@ -1,7 +1,7 @@
import api from "../axios";
import { API_ENDPOINTS } from "../endpoints";
import { ApiResponse } from "../types";
import { TCmsListResponse } from "../types/TCms";
import { TCms, TCmsListResponse } from "../types/TCms";
export const cmsService = {
getCms: async (): Promise<ApiResponse<TCmsListResponse>> => {
@@ -36,4 +36,18 @@ export const cmsService = {
throw error;
}
},
updateCms: async ({
id,
data,
}: {
id: string;
data: any;
}): Promise<{ data: TCms; message: string }> => {
try {
return (await api.put(API_ENDPOINTS.CMS.BASE(id), data)).data;
} catch (error) {
console.error("Error Caught in CMS Service => Update cms", error);
throw error;
}
},
};