mirror of
https://github.com/ArthurDanjou/artapi.git
synced 2026-01-26 18:50:25 +01:00
Refactor education and experiences API to use meta properties for sorting and mapping
Remove pretty-printing from resume link JSON response
This commit is contained in:
@@ -4,12 +4,12 @@ export default defineEventHandler(async (event) => {
|
|||||||
.all()
|
.all()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
.sort((a, b) => new Date(b.startDate).getTime() - new Date(a.startDate).getTime())
|
.sort((a, b) => new Date(b.meta.startDate).getTime() - new Date(a.meta.startDate).getTime())
|
||||||
.map(edu => ({
|
.map((edu) => ({
|
||||||
degree: edu.degree,
|
degree: edu.meta.degree,
|
||||||
institution: edu.institution,
|
institution: edu.meta.institution,
|
||||||
startDate: edu.startDate,
|
startDate: edu.meta.startDate,
|
||||||
endDate: edu.endDate,
|
endDate: edu.meta.endDate,
|
||||||
location: edu.location
|
location: edu.meta.location
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ export default defineEventHandler(async (event) => {
|
|||||||
.all()
|
.all()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
.sort((a, b) => new Date(b.startDate).getTime() - new Date(a.startDate).getTime())
|
.sort((a, b) => new Date(b.meta.startDate).getTime() - new Date(a.meta.startDate).getTime())
|
||||||
.map(exp => ({
|
.map(exp => ({
|
||||||
title: exp.title,
|
title: exp.meta.title,
|
||||||
company: exp.company,
|
company: exp.meta.company,
|
||||||
companyUrl: exp.companyUrl,
|
companyUrl: exp.meta.companyUrl,
|
||||||
startDate: exp.startDate,
|
startDate: exp.meta.startDate,
|
||||||
endDate: exp.endDate,
|
endDate: exp.meta.endDate,
|
||||||
location: exp.location,
|
location: exp.meta.location,
|
||||||
description: exp.description
|
description: exp.meta.description
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default defineMcpTool({
|
|||||||
const base_url = import.meta.dev ? 'http://localhost:3000/api' : 'https://mcp.arthurdanjou.fr/api'
|
const base_url = import.meta.dev ? 'http://localhost:3000/api' : 'https://mcp.arthurdanjou.fr/api'
|
||||||
const url = `${base_url}/resumes/${lang}`
|
const url = `${base_url}/resumes/${lang}`
|
||||||
return {
|
return {
|
||||||
content: [{ type: 'text', text: JSON.stringify(url, null, 2) }]
|
content: [{ type: 'text', text: JSON.stringify(url) }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user