api integrate of start-a-project form , captcha pending
This commit is contained in:
15
src/services/baseQuery.ts
Normal file
15
src/services/baseQuery.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { fetchBaseQuery } from '@reduxjs/toolkit/query/react';
|
||||
|
||||
const rawBaseQuery = fetchBaseQuery({
|
||||
baseUrl: 'https://wdiplcms.betadelivery.com',
|
||||
});
|
||||
|
||||
const baseQueryWithReauth = async (args: any, api: any, extraOptions: any) => {
|
||||
const result = await rawBaseQuery(args, api, extraOptions);
|
||||
|
||||
// Optional: reauthentication logic if result.error?.status === 401
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
export default baseQueryWithReauth;
|
||||
37
src/services/storeContactUs.ts
Normal file
37
src/services/storeContactUs.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// storeContactUs.service.ts
|
||||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
||||
import baseQueryWithReauth from "./baseQuery";
|
||||
|
||||
export type ContactUsFormData = {
|
||||
t_id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
country: string;
|
||||
phone_number: string;
|
||||
service: string;
|
||||
budget: string;
|
||||
message: string;
|
||||
development_stage: string;
|
||||
startTime: string;
|
||||
nda_signing: string | boolean;
|
||||
from_page: string;
|
||||
ip?: string;
|
||||
user_agent?: string;
|
||||
contact_us_attachment?: File;
|
||||
};
|
||||
|
||||
export const storeContactUs = createApi({
|
||||
reducerPath: "storeContactUs",
|
||||
baseQuery: baseQueryWithReauth,
|
||||
endpoints: (builder) => ({
|
||||
storeContactUs: builder.mutation<void, FormData>({
|
||||
query: (formData) => ({
|
||||
url: "/api/store-contact-us-data",
|
||||
method: "POST",
|
||||
body: formData,
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
export const { useStoreContactUsMutation } = storeContactUs;
|
||||
Reference in New Issue
Block a user