fix the response type

This commit is contained in:
Daniel Bulant 2022-09-19 17:43:18 +02:00 committed by GitHub
parent c212e18761
commit 99c7052808
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -238,9 +238,11 @@ export async function GET() {
return new Date(b.date) - new Date(a.date) return new Date(b.date) - new Date(a.date)
}); });
return { return new Response(JSON.stringify(allPosts.filter(t => new Date(t.date) < Date.now())), {
body: allPosts headers: {
}; 'Content-Type': 'application/json'
}
});
} }
``` ```