forum added
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
+11
-11
@@ -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 */}
|
||||
<div className="col-md-6 col-lg-6">
|
||||
<div className="img-block left-column wow fadeInRight">
|
||||
<img className="img-fluid" src="/images/img-14.png" alt="content-image" />
|
||||
<img className="img-fluid" src="/images/img-14.png" alt="content-image"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -85,27 +85,27 @@ export default function Home() {
|
||||
>
|
||||
{(props) => {
|
||||
return (
|
||||
<Form name="contactform" className="row contact-form">
|
||||
<Form name="contactform" className="row contact-form">
|
||||
{/* Form Select */}
|
||||
<div className="col-md-12 input-subject">
|
||||
<p className="p-lg">This question is
|
||||
about:{(props.errors.subject && props.touched.subject) &&
|
||||
<span style={{display: 'inline'}}
|
||||
className='text-danger'>{props.errors.subject}</span>}</p>
|
||||
<span>Choose a topic, so we know who to send your request to: </span>
|
||||
<span>Choose a topic, so we can best determine hot to handle your request to: </span>
|
||||
<select name='subject' onChange={props.handleChange}
|
||||
className="form-select subject"
|
||||
aria-label="Default select example">
|
||||
<option value=''>This question is about...</option>
|
||||
<option
|
||||
value='registering/authorising'>Registering/Authorising
|
||||
value='registering or account'>Registering or
|
||||
Accounts
|
||||
</option>
|
||||
<option value='using application'>Using
|
||||
Application
|
||||
<option value='using application'>Application
|
||||
</option>
|
||||
<option value='troubleshooting'>Troubleshooting
|
||||
</option>
|
||||
<option value='backup/restore'>Backup/Restore
|
||||
<option value='data and files'>Data or Files
|
||||
</option>
|
||||
<option value='others'>Other</option>
|
||||
</select>
|
||||
@@ -116,7 +116,7 @@ export default function Home() {
|
||||
Name:{(props.errors.name && props.touched.name) &&
|
||||
<span style={{display: 'inline'}}
|
||||
className='text-danger'>{props.errors.name}</span>}</p>
|
||||
<span>Please enter your real name: </span>
|
||||
<span>Please enter your name: </span>
|
||||
<input type="text" onChange={props.handleChange}
|
||||
name="name" className="form-control name"
|
||||
placeholder="Your Name*"/>
|
||||
@@ -126,7 +126,7 @@ export default function Home() {
|
||||
Address:{(props.errors.email && props.touched.email) &&
|
||||
<span style={{display: 'inline'}}
|
||||
className='text-danger'>{props.errors.email}</span>}</p>
|
||||
<span>Please carefully check your email address for accuracy</span>
|
||||
<span>Please carefully check your email address for accuracy:</span>
|
||||
<input type="text" onChange={props.handleChange}
|
||||
name="email" className="form-control email"
|
||||
placeholder="Email Address*"/>
|
||||
@@ -136,7 +136,7 @@ export default function Home() {
|
||||
details:{(props.errors.message && props.touched.message) &&
|
||||
<span style={{display: 'inline'}}
|
||||
className='text-danger'>{props.errors.message}</span>}</p>
|
||||
<span>Your OS version, MERMS version & build, steps you did. Be VERY precise!</span>
|
||||
<span>Details like yur Your OS version, browser and any specific steps will really help. Be VERY precise!</span>
|
||||
<textarea onChange={props.handleChange}
|
||||
className="form-control message"
|
||||
name="message" rows={6}
|
||||
|
||||
Reference in New Issue
Block a user