From b58d576e86ac272911f4bff73fcd84872b26cb19 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 28 Dec 2025 20:14:57 -0500 Subject: [PATCH] forum added --- components/services/services.js | 38 +++++++++++++++++++++++---------- pages/contacts.js | 22 +++++++++---------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/components/services/services.js b/components/services/services.js index 459ceb4..207633b 100644 --- a/components/services/services.js +++ b/components/services/services.js @@ -1,4 +1,5 @@ import axios from "axios" +import {string} from "yup"; axios.interceptors.request.use( @@ -10,9 +11,9 @@ axios.interceptors.request.use( // "Access-Control-Allow-Headers": "Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token", // "Content-Type": "application/json;charset=UTF-8", // 'Authorization': (localStorage && localStorage.getItem('access_token')) ? `Bearer ${localStorage.getItem('access_token')}` : '', - }; - // config.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`; - // config.baseURL = process.env.REACT_APP_MAIN_API + }; + // config.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`; + // config.baseURL = process.env.REACT_APP_MAIN_API return config; }, error => { @@ -20,15 +21,23 @@ axios.interceptors.request.use( } ); -const postAuxEnd = (path, postData, media=false) => { +const blogBasePath = () => { + return 'https://blogdata.chiefsoft.net'; +} + +const siteServerPath = () => { + // NEXT_PUBLIC_APP_MAIN_API="https://devapi.mermsemr.com" + return 'https://devapi.mermsemr.com'; +} +const postAuxEnd = (path, postData, media = false) => { const basePath = media ? 'https://blogdata.chiefsoft.net' : 'https://blogdata.chiefsoft.net' let newPostData = {} - if(!media){ + if (!media) { newPostData = {...postData} - }else{ + } else { newPostData = new FormData(); for (let data in postData) { - newPostData.append(data, postData[data]); + newPostData.append(data, postData[data]); } } return axios.post(`${basePath}${path}`, newPostData).then(res => { @@ -39,9 +48,9 @@ const postAuxEnd = (path, postData, media=false) => { }) } -const getAuxEnd = (path, reqData= null) => { - const basePath = 'https://blogdata.chiefsoft.net' - return axios.get(`${basePath}${path}`,{ params: reqData }).then(res => { +const getAuxEnd = (basePath, path, reqData = null) => { + // const basePath = 'https://blogdata.chiefsoft.net' + return axios.get(`${basePath}${path}`, {params: reqData}).then(res => { return res // localStorage.clear(); // window.location.href = `/login?sessionExpired=true`; @@ -57,5 +66,12 @@ export const getMermsBlogs = (reqData) => { let postData = { ...reqData } - return getAuxEnd('/mermsblogdata/mermsemr', postData, false) + return getAuxEnd(blogBasePath(), '/mermsblogdata/mermsemr', postData) +} + +export const serMermsWebContact = (reqData) => { + let postData = { + ...reqData + } + return getAuxEnd(siteServerPath(), '/mermsblogdata/mermsemr', postData) } diff --git a/pages/contacts.js b/pages/contacts.js index d116744..8230180 100644 --- a/pages/contacts.js +++ b/pages/contacts.js @@ -42,7 +42,7 @@ export default function Home() { setTimeout(() => { contactMutation.reset() }, 3000) - contactMutation.mutate(reqData) + contactMutation.mutate(reqData) } return ( @@ -72,7 +72,7 @@ export default function Home() { {/* IMAGE BLOCK */}
- content-image + content-image
@@ -85,27 +85,27 @@ export default function Home() { > {(props) => { return ( -
+ {/* Form Select */}

This question is about:{(props.errors.subject && props.touched.subject) && {props.errors.subject}}

- Choose a topic, so we know who to send your request to: + Choose a topic, so we can best determine hot to handle your request to: @@ -116,7 +116,7 @@ export default function Home() { Name:{(props.errors.name && props.touched.name) && {props.errors.name}}

- Please enter your real name: + Please enter your name: @@ -126,7 +126,7 @@ export default function Home() { Address:{(props.errors.email && props.touched.email) && {props.errors.email}}

- Please carefully check your email address for accuracy + Please carefully check your email address for accuracy: @@ -136,7 +136,7 @@ export default function Home() { details:{(props.errors.message && props.touched.message) && {props.errors.message}}

- Your OS version, MERMS version & build, steps you did. Be VERY precise! + Details like yur Your OS version, browser and any specific steps will really help. Be VERY precise!