mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 16:51:33 +10:00
using fetch instead of axios, should fix the issue
This commit is contained in:
@ -63,28 +63,13 @@ export const fetchResumeByIdentifier = async ({
|
|||||||
options = { secretKey: '' },
|
options = { secretKey: '' },
|
||||||
}: FetchResumeByIdentifierParams) => {
|
}: FetchResumeByIdentifierParams) => {
|
||||||
if (!isBrowser) {
|
if (!isBrowser) {
|
||||||
|
const serverUrl = env('SERVER_URL');
|
||||||
const secretKey = options.secretKey;
|
const secretKey = options.secretKey;
|
||||||
|
|
||||||
const resume = await axios
|
return fetch(`${serverUrl}/resume/${username}/${slug}?secretKey=${secretKey}`).then((response) => response.json());
|
||||||
.get<Resume>(`/resume/${username}/${slug}`, { params: { secretKey } })
|
|
||||||
.then((res) => res.data);
|
|
||||||
|
|
||||||
console.log('ResumeService~fetchResumeByIdentifier', 'using axios', JSON.stringify(resume));
|
|
||||||
|
|
||||||
const resumeJSON = await fetch(env('SERVER_URL') + `/resume/${username}/${slug}?secretKey=${secretKey}`).then(
|
|
||||||
(response) => response.json()
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log('ResumeService~fetchResumeByIdentifier', 'using fetch', JSON.stringify(resumeJSON));
|
|
||||||
|
|
||||||
return resume;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const resume = await axios.get<Resume>(`/resume/${username}/${slug}`).then((res) => res.data);
|
return axios.get<Resume>(`/resume/${username}/${slug}`).then((res) => res.data);
|
||||||
|
|
||||||
console.log('ResumeService~fetchResumeByIdentifier', 'isBrowser', JSON.stringify(resume));
|
|
||||||
|
|
||||||
return resume;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchResumeByShortId = async ({ shortId }: FetchResumeByShortIdParams) =>
|
export const fetchResumeByShortId = async ({ shortId }: FetchResumeByShortIdParams) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user