Skip to content

Commit

Permalink
prod: change api url in client to deployed url
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayobami6 committed Oct 28, 2023
1 parent 898f580 commit a5c45f9
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 32 deletions.
2 changes: 1 addition & 1 deletion client/src/api/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions client/src/api/certifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 10 additions & 4 deletions client/src/api/education.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
14 changes: 10 additions & 4 deletions client/src/api/experience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
16 changes: 11 additions & 5 deletions client/src/api/offer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
4 changes: 3 additions & 1 deletion client/src/api/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
14 changes: 10 additions & 4 deletions client/src/api/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
7 changes: 5 additions & 2 deletions client/src/api/score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
14 changes: 10 additions & 4 deletions client/src/api/skills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
9 changes: 6 additions & 3 deletions client/src/api/talent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

0 comments on commit a5c45f9

Please sign in to comment.