feat: Enhance portfolio with SEO meta tags, implement API for experie… (#2)
* feat: Enhance portfolio with SEO meta tags, implement API for experiences and projects, and refactor components for improved structure * fix: address Copilot review comments on PR #2 - Migrate Grid callers to the System Grid size prop (GridWrapper) - Render experience icons from exp.type instead of exp.icon - Show experience date range (dateS-dateE) on desktop and mobile - Select experience description from the active i18n language - Restore technology chips from exp.technologies - Rename uesExperience hook to useExperience - Normalize getProjets response to the { data, count } shape - Return ExperienceFull from getExperience - Type useEditProjet/updateProjet with ProjetEdit - Fetch project details from the API in Projet page (useProjet) - Replace ExperienceType enum with const object (erasableSyntaxOnly) - Sync document lang attribute with the active language
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import axios from "axios";
|
||||
import type { Experiencecreate, ExperienceFull, Experiences } from "../types/experience";
|
||||
|
||||
|
||||
export async function getExperiences(): Promise<Experiences> {
|
||||
const url = import.meta.env.VITE_API_URL + "/experiences";
|
||||
const experiences = await axios.get(url);
|
||||
return experiences.data;
|
||||
}
|
||||
|
||||
export async function getExperience(id: number): Promise<ExperienceFull> {
|
||||
const url = import.meta.env.VITE_API_URL + "/experience/" + id;
|
||||
const experience = await axios.get(url);
|
||||
return experience.data;
|
||||
}
|
||||
|
||||
export async function createExperience(experience: Experiencecreate): Promise<Experiencecreate> {
|
||||
const url = import.meta.env.VITE_API_URL + "/experiences";
|
||||
const newexperience = await axios.post(url, experience);
|
||||
return newexperience.data;
|
||||
}
|
||||
|
||||
export async function deleteExperience(id: number): Promise<void> {
|
||||
const url = import.meta.env.VITE_API_URL + "/experience/" + id;
|
||||
await axios.delete(url);
|
||||
}
|
||||
Reference in New Issue
Block a user