mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-25 17:30:32 +01:00
Remvoe useless functions
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import type { Education, JsonParsedContent, Post, Project, Skill, WorkExperience } from '../../types'
|
import type { Education, JsonParsedContent, Post, Project, Skill, WorkExperience } from '~~/types'
|
||||||
|
|
||||||
export function useProjects() {
|
export function useProjects() {
|
||||||
return useAsyncData('content:projects', () => {
|
return useAsyncData('content:projects', () => {
|
||||||
@@ -6,17 +6,6 @@ export function useProjects() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useLatestProject() {
|
|
||||||
return useAsyncData('content:latestProject', () => {
|
|
||||||
return queryContent<Project>('projects')
|
|
||||||
.where({
|
|
||||||
latest: true,
|
|
||||||
})
|
|
||||||
.limit(1)
|
|
||||||
.findOne()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useEducations() {
|
export function useEducations() {
|
||||||
return useAsyncData('content:educations', () => {
|
return useAsyncData('content:educations', () => {
|
||||||
return queryContent<Education>('educations')
|
return queryContent<Education>('educations')
|
||||||
@@ -49,12 +38,3 @@ export function usePosts() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useLatestPost() {
|
|
||||||
return useAsyncData('content:latestPost', async () => {
|
|
||||||
const posts = await queryContent<Post>('writing').find()
|
|
||||||
return posts.sort((a, b) => {
|
|
||||||
return new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime()
|
|
||||||
})[0]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user