forum added
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
|
import {string} from "yup";
|
||||||
|
|
||||||
|
|
||||||
axios.interceptors.request.use(
|
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",
|
// "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",
|
// "Content-Type": "application/json;charset=UTF-8",
|
||||||
// 'Authorization': (localStorage && localStorage.getItem('access_token')) ? `Bearer ${localStorage.getItem('access_token')}` : '',
|
// 'Authorization': (localStorage && localStorage.getItem('access_token')) ? `Bearer ${localStorage.getItem('access_token')}` : '',
|
||||||
};
|
};
|
||||||
// config.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`;
|
// config.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`;
|
||||||
// config.baseURL = process.env.REACT_APP_MAIN_API
|
// config.baseURL = process.env.REACT_APP_MAIN_API
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
error => {
|
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'
|
const basePath = media ? 'https://blogdata.chiefsoft.net' : 'https://blogdata.chiefsoft.net'
|
||||||
let newPostData = {}
|
let newPostData = {}
|
||||||
if(!media){
|
if (!media) {
|
||||||
newPostData = {...postData}
|
newPostData = {...postData}
|
||||||
}else{
|
} else {
|
||||||
newPostData = new FormData();
|
newPostData = new FormData();
|
||||||
for (let data in postData) {
|
for (let data in postData) {
|
||||||
newPostData.append(data, postData[data]);
|
newPostData.append(data, postData[data]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return axios.post(`${basePath}${path}`, newPostData).then(res => {
|
return axios.post(`${basePath}${path}`, newPostData).then(res => {
|
||||||
@@ -39,9 +48,9 @@ const postAuxEnd = (path, postData, media=false) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getAuxEnd = (path, reqData= null) => {
|
const getAuxEnd = (basePath, path, reqData = null) => {
|
||||||
const basePath = 'https://blogdata.chiefsoft.net'
|
// const basePath = 'https://blogdata.chiefsoft.net'
|
||||||
return axios.get(`${basePath}${path}`,{ params: reqData }).then(res => {
|
return axios.get(`${basePath}${path}`, {params: reqData}).then(res => {
|
||||||
return res
|
return res
|
||||||
// localStorage.clear();
|
// localStorage.clear();
|
||||||
// window.location.href = `/login?sessionExpired=true`;
|
// window.location.href = `/login?sessionExpired=true`;
|
||||||
@@ -57,5 +66,12 @@ export const getMermsBlogs = (reqData) => {
|
|||||||
let postData = {
|
let postData = {
|
||||||
...reqData
|
...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(() => {
|
setTimeout(() => {
|
||||||
contactMutation.reset()
|
contactMutation.reset()
|
||||||
}, 3000)
|
}, 3000)
|
||||||
contactMutation.mutate(reqData)
|
contactMutation.mutate(reqData)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -72,7 +72,7 @@ export default function Home() {
|
|||||||
{/* IMAGE BLOCK */}
|
{/* IMAGE BLOCK */}
|
||||||
<div className="col-md-6 col-lg-6">
|
<div className="col-md-6 col-lg-6">
|
||||||
<div className="img-block left-column wow fadeInRight">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -85,27 +85,27 @@ export default function Home() {
|
|||||||
>
|
>
|
||||||
{(props) => {
|
{(props) => {
|
||||||
return (
|
return (
|
||||||
<Form name="contactform" className="row contact-form">
|
<Form name="contactform" className="row contact-form">
|
||||||
{/* Form Select */}
|
{/* Form Select */}
|
||||||
<div className="col-md-12 input-subject">
|
<div className="col-md-12 input-subject">
|
||||||
<p className="p-lg">This question is
|
<p className="p-lg">This question is
|
||||||
about:{(props.errors.subject && props.touched.subject) &&
|
about:{(props.errors.subject && props.touched.subject) &&
|
||||||
<span style={{display: 'inline'}}
|
<span style={{display: 'inline'}}
|
||||||
className='text-danger'>{props.errors.subject}</span>}</p>
|
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}
|
<select name='subject' onChange={props.handleChange}
|
||||||
className="form-select subject"
|
className="form-select subject"
|
||||||
aria-label="Default select example">
|
aria-label="Default select example">
|
||||||
<option value=''>This question is about...</option>
|
<option value=''>This question is about...</option>
|
||||||
<option
|
<option
|
||||||
value='registering/authorising'>Registering/Authorising
|
value='registering or account'>Registering or
|
||||||
|
Accounts
|
||||||
</option>
|
</option>
|
||||||
<option value='using application'>Using
|
<option value='using application'>Application
|
||||||
Application
|
|
||||||
</option>
|
</option>
|
||||||
<option value='troubleshooting'>Troubleshooting
|
<option value='troubleshooting'>Troubleshooting
|
||||||
</option>
|
</option>
|
||||||
<option value='backup/restore'>Backup/Restore
|
<option value='data and files'>Data or Files
|
||||||
</option>
|
</option>
|
||||||
<option value='others'>Other</option>
|
<option value='others'>Other</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -116,7 +116,7 @@ export default function Home() {
|
|||||||
Name:{(props.errors.name && props.touched.name) &&
|
Name:{(props.errors.name && props.touched.name) &&
|
||||||
<span style={{display: 'inline'}}
|
<span style={{display: 'inline'}}
|
||||||
className='text-danger'>{props.errors.name}</span>}</p>
|
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}
|
<input type="text" onChange={props.handleChange}
|
||||||
name="name" className="form-control name"
|
name="name" className="form-control name"
|
||||||
placeholder="Your Name*"/>
|
placeholder="Your Name*"/>
|
||||||
@@ -126,7 +126,7 @@ export default function Home() {
|
|||||||
Address:{(props.errors.email && props.touched.email) &&
|
Address:{(props.errors.email && props.touched.email) &&
|
||||||
<span style={{display: 'inline'}}
|
<span style={{display: 'inline'}}
|
||||||
className='text-danger'>{props.errors.email}</span>}</p>
|
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}
|
<input type="text" onChange={props.handleChange}
|
||||||
name="email" className="form-control email"
|
name="email" className="form-control email"
|
||||||
placeholder="Email Address*"/>
|
placeholder="Email Address*"/>
|
||||||
@@ -136,7 +136,7 @@ export default function Home() {
|
|||||||
details:{(props.errors.message && props.touched.message) &&
|
details:{(props.errors.message && props.touched.message) &&
|
||||||
<span style={{display: 'inline'}}
|
<span style={{display: 'inline'}}
|
||||||
className='text-danger'>{props.errors.message}</span>}</p>
|
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}
|
<textarea onChange={props.handleChange}
|
||||||
className="form-control message"
|
className="form-control message"
|
||||||
name="message" rows={6}
|
name="message" rows={6}
|
||||||
|
|||||||
Reference in New Issue
Block a user