rename functions

This commit is contained in:
2023-12-14 17:08:26 +01:00
parent 12a4b79179
commit 771cc24afc
3 changed files with 9 additions and 9 deletions

View File

@@ -1,12 +1,12 @@
import type { Education, JsonParsedContent, Post, Project, Skill, WorkExperience } from '~~/types'
export function useProjects() {
export function getProjects() {
return useAsyncData('content:projects', () => {
return queryContent<Project>('projects').find()
})
}
export function useEducations() {
export function getEducations() {
return useAsyncData('content:educations', () => {
return queryContent<Education>('educations')
.sort({
@@ -16,7 +16,7 @@ export function useEducations() {
})
}
export function useWorkExperiences() {
export function getWorkExperiences() {
return useAsyncData('content:experiences', () => {
return queryContent<WorkExperience>('experiences')
.sort({
@@ -26,11 +26,11 @@ export function useWorkExperiences() {
})
}
export function useSkills() {
export function getSkills() {
return useAsyncData('content:skills', () => queryContent<JsonParsedContent<Skill[]>>('skills').findOne())
}
export function usePosts() {
export function getPosts() {
return useAsyncData('content:posts', async () => {
const posts = await queryContent<Post>('writing').find()
return posts.sort((a, b) => {

View File

@@ -3,9 +3,9 @@ useHead({
title: 'About me • Arthur Danjou',
})
const { data: skills } = await useSkills()
const { data: educations } = await useEducations()
const { data: experiences } = await useWorkExperiences()
const { data: skills } = await getSkills()
const { data: educations } = await getEducations()
const { data: experiences } = await getWorkExperiences()
</script>
<template>

View File

@@ -8,7 +8,7 @@ useHead({
title: 'My work • Arthur Danjou',
})
const { data: projects } = await useProjects()
const { data: projects } = await getProjects()
</script>
<template>