Fixed error when including buckets on post query

This commit is contained in:
2024-06-23 23:32:23 +02:00
parent 7fd4b8d3e2
commit 39f3c02e7c
2 changed files with 2 additions and 2 deletions
@@ -23,7 +23,7 @@ export async function deletePost(postID: number): Promise<ActionResult<boolean>>
export async function getPosts(): Promise<ActionResult<Attributes<Post>[]>> {
await dbSync;
if(! await userIsAdmin()) return {error:"Unauthorized, not fetching Posts."}
const posts = await Post.findAll({include: {association: Post.associations.postBuckets, include: Bucket.associations.attachments}},);
const posts = await Post.findAll({include: {association: Post.associations.buckets, include: Bucket.associations.attachments}},);
return {result:JSON.parse(JSON.stringify(posts))};
}