responsive and other changes

This commit is contained in:
priyanshuvish
2025-09-05 12:20:05 +05:30
parent 62cff29657
commit a43225db9b
18 changed files with 228 additions and 58 deletions

15
src/services/baseQuery.ts Normal file
View File

@@ -0,0 +1,15 @@
import { fetchBaseQuery } from '@reduxjs/toolkit/query/react';
const rawBaseQuery = fetchBaseQuery({
baseUrl: 'http://localhost:3000/api',
});
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;

View File

@@ -0,0 +1,37 @@
// storeSwitchToDashboard.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 storeSwitchToDashboard = createApi({
reducerPath: "storeSwitchToDashboard",
baseQuery: baseQueryWithReauth,
endpoints: (builder) => ({
storeSwitchToDashboard: builder.mutation<void, FormData>({
query: (formData) => ({
url: "/api/store-contact-us-data",
method: "POST",
body: formData,
}),
}),
}),
});
export const { useStoreSwitchToDashboardMutation } = storeSwitchToDashboard;