mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-14 20:19:35 +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() {
|
||||
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() {
|
||||
return useAsyncData('content: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