Change Post Sort

This commit is contained in:
Flycro
2022-06-18 21:04:56 +02:00
parent 4823651497
commit 3f50b86fc7
3 changed files with 9 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ export const usePostStore = defineStore('post', () => {
postList.value = []
errors.value = []
loading.value = true
const result = await fetch('https://api.flycro.me/items/Post')
const result = await fetch('https://api.flycro.me/items/Post?sort=-date_created')
if (!result.ok) errors.value.push({ message: 'Failed to fetch posts' })
const data = await result.json()
data.data.forEach((item) => {