From a5c45f91ae64c0726910a3ecfe17263d3eb79763 Mon Sep 17 00:00:00 2001 From: Ayobami Date: Sat, 28 Oct 2023 14:36:57 +0100 Subject: [PATCH] prod: change api url in client to deployed url --- client/src/api/auth.tsx | 2 +- client/src/api/certifications.ts | 8 ++++---- client/src/api/education.ts | 14 ++++++++++---- client/src/api/experience.ts | 14 ++++++++++---- client/src/api/offer.ts | 16 +++++++++++----- client/src/api/pagination.ts | 4 +++- client/src/api/project.ts | 14 ++++++++++---- client/src/api/score.ts | 7 +++++-- client/src/api/skills.ts | 14 ++++++++++---- client/src/api/talent.ts | 9 ++++++--- 10 files changed, 70 insertions(+), 32 deletions(-) diff --git a/client/src/api/auth.tsx b/client/src/api/auth.tsx index 1418109..bd2ec81 100644 --- a/client/src/api/auth.tsx +++ b/client/src/api/auth.tsx @@ -12,7 +12,7 @@ export const authenticate = async ( credentials: AuthCredentials, ) => { const res = await axios.post( - `http://localhost:3000/${endpoint}`, + `https://meetdevs-api.onrender.com/${endpoint}`, credentials, ); return res; diff --git a/client/src/api/certifications.ts b/client/src/api/certifications.ts index e4f5883..64c98cf 100644 --- a/client/src/api/certifications.ts +++ b/client/src/api/certifications.ts @@ -3,26 +3,26 @@ import axios from 'axios'; export const getTalentCertifications = (talentId) => { const talentCertifications = axios.get( - `http://localhost:3000/certifications/talent/${talentId}`, + `https://meetdevs-api.onrender.com/certifications/talent/${talentId}`, ); return talentCertifications; }; export const updateCertification = (id, certification) => { const res = axios.put( - `http://localhost:3000/certifications/${id}`, + `https://meetdevs-api.onrender.com/certifications/${id}`, certification, ); return res; }; export const deleteCertification = (id) => { - axios.delete(`http://localhost:3000/certifications/${id}`); + axios.delete(`https://meetdevs-api.onrender.com/certifications/${id}`); }; export const createCertification = (certificationData) => { const data = axios.post( - 'http://localhost:3000/certifications', + 'https://meetdevs-api.onrender.com/certifications', certificationData, ); return data; diff --git a/client/src/api/education.ts b/client/src/api/education.ts index 503f4cf..7eeab44 100644 --- a/client/src/api/education.ts +++ b/client/src/api/education.ts @@ -3,21 +3,27 @@ import axios from 'axios'; export const getTalentEducations = (talentId) => { const talentEducations = axios.get( - `http://localhost:3000/educations/talent/${talentId}`, + `https://meetdevs-api.onrender.com/educations/talent/${talentId}`, ); return talentEducations; }; export const updateEducation = (id, education) => { - const res = axios.put(`http://localhost:3000/educations/${id}`, education); + const res = axios.put( + `https://meetdevs-api.onrender.com/educations/${id}`, + education, + ); return res; }; export const deleteEducation = (id) => { - axios.delete(`http://localhost:3000/educations/${id}`); + axios.delete(`https://meetdevs-api.onrender.com/educations/${id}`); }; export const createEducation = (educationData) => { - const data = axios.post('http://localhost:3000/educations', educationData); + const data = axios.post( + 'https://meetdevs-api.onrender.com/educations', + educationData, + ); return data; }; diff --git a/client/src/api/experience.ts b/client/src/api/experience.ts index 062776b..c26a59f 100644 --- a/client/src/api/experience.ts +++ b/client/src/api/experience.ts @@ -3,21 +3,27 @@ import axios from 'axios'; export const getTalentExperiences = (talentId) => { const talentExperiences = axios.get( - `http://localhost:3000/experiences/talent/${talentId}`, + `https://meetdevs-api.onrender.com/experiences/talent/${talentId}`, ); return talentExperiences; }; export const updateExperience = (id, experience) => { - const res = axios.put(`http://localhost:3000/experiences/${id}`, experience); + const res = axios.put( + `https://meetdevs-api.onrender.com/experiences/${id}`, + experience, + ); return res; }; export const deleteExperience = (id) => { - axios.delete(`http://localhost:3000/experiences/${id}`); + axios.delete(`https://meetdevs-api.onrender.com/experiences/${id}`); }; export const createExperience = (experienceData) => { - const data = axios.post('http://localhost:3000/experiences', experienceData); + const data = axios.post( + 'https://meetdevs-api.onrender.com/experiences', + experienceData, + ); return data; }; diff --git a/client/src/api/offer.ts b/client/src/api/offer.ts index 64eda6e..d9749db 100644 --- a/client/src/api/offer.ts +++ b/client/src/api/offer.ts @@ -3,28 +3,34 @@ import axios from 'axios'; export const getTalentOffers = (talentId) => { const talentOffers = axios.get( - `http://localhost:3000/offers/talent/${talentId}`, + `https://meetdevs-api.onrender.com/offers/talent/${talentId}`, ); return talentOffers; }; export const getEmployerOffers = (employerId) => { const employerOffers = axios.get( - `http://localhost:3000/offers/employer/${employerId}`, + `https://meetdevs-api.onrender.com/offers/employer/${employerId}`, ); return employerOffers; }; export const updateOffer = (id, offer) => { - const res = axios.patch(`http://localhost:3000/offers/${id}`, offer); + const res = axios.patch( + `https://meetdevs-api.onrender.com/offers/${id}`, + offer, + ); return res; }; export const deleteOffer = (id) => { - axios.delete(`http://localhost:3000/offers/${id}`); + axios.delete(`https://meetdevs-api.onrender.com/offers/${id}`); }; export const createOffer = (offerData) => { - const data = axios.post('http://localhost:3000/offers', offerData); + const data = axios.post( + 'https://meetdevs-api.onrender.com/offers', + offerData, + ); return data; }; diff --git a/client/src/api/pagination.ts b/client/src/api/pagination.ts index be2283e..9501516 100644 --- a/client/src/api/pagination.ts +++ b/client/src/api/pagination.ts @@ -2,6 +2,8 @@ import axios from 'axios'; export const talentsPerPage = (pageNo) => { - const talents = axios.get(`http://localhost:3000/api/talents?page=${pageNo}`); + const talents = axios.get( + `https://meetdevs-api.onrender.com/api/talents?page=${pageNo}`, + ); return talents; }; diff --git a/client/src/api/project.ts b/client/src/api/project.ts index 30aeb4a..14a7614 100644 --- a/client/src/api/project.ts +++ b/client/src/api/project.ts @@ -3,21 +3,27 @@ import axios from 'axios'; export const getTalentProjects = (talentId) => { const talentProjects = axios.get( - `http://localhost:3000/projects/talent/${talentId}`, + `https://meetdevs-api.onrender.com/projects/talent/${talentId}`, ); return talentProjects; }; export const updateProject = (id, project) => { - const res = axios.put(`http://localhost:3000/projects/${id}`, project); + const res = axios.put( + `https://meetdevs-api.onrender.com/projects/${id}`, + project, + ); return res; }; export const deleteProject = (id) => { - axios.delete(`http://localhost:3000/projects/${id}`); + axios.delete(`https://meetdevs-api.onrender.com/projects/${id}`); }; export const createProject = (projectData) => { - const data = axios.post('http://localhost:3000/projects', projectData); + const data = axios.post( + 'https://meetdevs-api.onrender.com/projects', + projectData, + ); return data; }; diff --git a/client/src/api/score.ts b/client/src/api/score.ts index fe90564..31dc15e 100644 --- a/client/src/api/score.ts +++ b/client/src/api/score.ts @@ -2,12 +2,15 @@ import axios from 'axios'; export const getTalentScores = () => { - const talentScores = axios.get('http://localhost:3000/scores'); + const talentScores = axios.get('https://meetdevs-api.onrender.com/scores'); return talentScores; }; // update | create score export const updateScore = (talentId, scoreData) => { - const res = axios.put(`http://localhost:3000/scores/${talentId}`, scoreData); + const res = axios.put( + `https://meetdevs-api.onrender.com/scores/${talentId}`, + scoreData, + ); return res; }; diff --git a/client/src/api/skills.ts b/client/src/api/skills.ts index 1462a13..16a86a3 100644 --- a/client/src/api/skills.ts +++ b/client/src/api/skills.ts @@ -3,21 +3,27 @@ import axios from 'axios'; export const getTalentSkills = (talentId) => { const talentSkills = axios.get( - `http://localhost:3000/skills/talent/${talentId}`, + `https://meetdevs-api.onrender.com/skills/talent/${talentId}`, ); return talentSkills; }; export const updateSkill = (id, skill) => { - const res = axios.put(`http://localhost:3000/skills/${id}`, skill); + const res = axios.put( + `https://meetdevs-api.onrender.com/skills/${id}`, + skill, + ); return res; }; export const deleteSkill = (id) => { - axios.delete(`http://localhost:3000/skills/${id}`); + axios.delete(`https://meetdevs-api.onrender.com/skills/${id}`); }; export const createSkill = (skillData) => { - const data = axios.post('http://localhost:3000/skills', skillData); + const data = axios.post( + 'https://meetdevs-api.onrender.com/skills', + skillData, + ); return data; }; diff --git a/client/src/api/talent.ts b/client/src/api/talent.ts index f5c4803..32ffe9e 100644 --- a/client/src/api/talent.ts +++ b/client/src/api/talent.ts @@ -2,16 +2,19 @@ import axios from 'axios'; export const getAllTalents = () => { - const talents = axios.get('http://localhost:3000/talents'); + const talents = axios.get('https://meetdevs-api.onrender.com/talents'); return talents; }; export const getATalent = (id) => { - const talent = axios.get(`http://localhost:3000/talents/${id}`); + const talent = axios.get(`https://meetdevs-api.onrender.com/talents/${id}`); return talent; }; export const patchTalent = (id, data) => { - const talent = axios.patch(`http://localhost:3000/talents/${id}`, data); + const talent = axios.patch( + `https://meetdevs-api.onrender.com/talents/${id}`, + data, + ); return talent; };