feat(marketing): Refactor marketing wizard steps and add data collection methods

- Moved all marketing wizard step components to `create/_components` directory
- Added `collectData` static method to each step component for data retrieval
- Reorganized file structure to improve component modularity
- Prepared steps for dynamic data collection in wizard workflow
- Added VSCode settings file for project configuration
- Introduced new CMS-related components and services
- Updated API endpoints and added new query hooks
This commit is contained in:
AmirReza Jamali
2025-11-09 14:53:36 +03:30
parent f9bd7fce4b
commit cdc8cde6a4
26 changed files with 414 additions and 63 deletions
+3
View File
@@ -3,6 +3,9 @@ export const API_ENDPOINTS = {
POSTS: {
READ_ALL: "posts ",
},
CMS: {
BASE: (id?: string) => (id ? `cms/${id}` : "cms"),
},
USER: {
LOGIN: "profile/login",
LOGOUT: "profile/logout",
+23
View File
@@ -0,0 +1,23 @@
import api from "../axios";
import { API_ENDPOINTS } from "../endpoints";
import { ApiResponse } from "../types";
import { TCmsResponse } from "../types/TCms";
export const cmsService = {
getCms: async (): Promise<ApiResponse<TCmsResponse>> => {
try {
return (await api.get(API_ENDPOINTS.CMS.BASE())).data;
} catch (error) {
console.error("Error Caught in CMS Service => Get cms", error);
throw error;
}
},
createCms: async (data: any) => {
try {
return (await api.post(API_ENDPOINTS.CMS.BASE(), data)).data;
} catch (error) {
console.error("Error Caught in CMS Service => Create cms", error);
throw error;
}
},
};
+84
View File
@@ -0,0 +1,84 @@
import { z } from "zod";
const CmsSchema = z.object({
cms: z.array(
z.object({
advantages: z.object({
cards: z.array(
z.object({
description: z.string(),
icon: z.string(),
title: z.string(),
}),
),
description: z.string(),
title: z.string(),
}),
challenges: z.object({
cards: z.array(
z.object({
description: z.string(),
icon: z.string(),
title: z.string(),
}),
),
description: z.string(),
title: z.string(),
}),
chart: z.object({
data: z.array(
z.object({
key: z.string(),
value: z.number(),
}),
),
missedAmount: z.string(),
title: z.string(),
}),
contact: z.object({
description: z.string(),
fields: z.array(
z.object({
label: z.string(),
name: z.string(),
placeholder: z.string(),
required: z.boolean(),
}),
),
submitButtonText: z.string(),
title: z.string(),
}),
features: z.object({
cards: z.array(
z.object({
description: z.string(),
icon: z.string(),
title: z.string(),
}),
),
description: z.string(),
title: z.string(),
}),
footer: z.object({
copyright: z.string(),
email: z.string(),
location: z.string(),
phone: z.string(),
tagline: z.string(),
}),
hero: z.object({
buttonLink: z.string(),
buttonText: z.string(),
description: z.string(),
gifFile: z.string(),
title: z.string(),
}),
created_at: z.number(),
updated_at: z.number(),
id: z.string(),
key: z.string(),
type: z.string(),
}),
),
});
export type TCmsResponse = z.infer<typeof CmsSchema>;