mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-06 16:20:08 +00:00
feat: add api client to frontend
This commit is contained in:
parent
0465b46650
commit
e376149c84
1 changed files with 33 additions and 0 deletions
|
|
@ -111,6 +111,17 @@ export const apiUploadCoverLetter = async (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const apiDeleteCoverLetter = async (): Promise<boolean> => {
|
||||||
|
try {
|
||||||
|
await axios.delete(API_URL + '/candidate/remove/cover_letter', {
|
||||||
|
withCredentials: true,
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
throw errorHandler(e, 'Failed to delete cover letter');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const apiUploadPortfolioLetter = async (
|
export const apiUploadPortfolioLetter = async (
|
||||||
letter: File,
|
letter: File,
|
||||||
progressReporter: (progress: AxiosProgressEvent) => void
|
progressReporter: (progress: AxiosProgressEvent) => void
|
||||||
|
|
@ -130,6 +141,17 @@ export const apiUploadPortfolioLetter = async (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const apiDeletePortfolioLetter = async (): Promise<boolean> => {
|
||||||
|
try {
|
||||||
|
await axios.delete(API_URL + '/candidate/remove/portfolio_letter', {
|
||||||
|
withCredentials: true,
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
throw errorHandler(e, 'Failed to delete portfolio letter');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const apiUploadPortfolioZip = async (
|
export const apiUploadPortfolioZip = async (
|
||||||
portfolio: File,
|
portfolio: File,
|
||||||
progressReporter: (progress: AxiosProgressEvent) => void
|
progressReporter: (progress: AxiosProgressEvent) => void
|
||||||
|
|
@ -149,6 +171,17 @@ export const apiUploadPortfolioZip = async (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const apiDeletePortfolioZip = async (): Promise<boolean> => {
|
||||||
|
try {
|
||||||
|
await axios.delete(API_URL + '/candidate/remove/portfolio_zip', {
|
||||||
|
withCredentials: true,
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
throw errorHandler(e, 'Failed to delete portfolio zip');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const apiSubmitPortfolio = async (): Promise<boolean> => {
|
export const apiSubmitPortfolio = async (): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
await axios.post(API_URL + '/candidate/portfolio/submit', {}, { withCredentials: true });
|
await axios.post(API_URL + '/candidate/portfolio/submit', {}, { withCredentials: true });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue