From 39f3c02e7c0990430d7723d24ae8fd3eac090cc5 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 23 Jun 2024 23:32:23 +0200 Subject: [PATCH] Fixed error when including buckets on post query --- src/app/lib/actions/entityManagement/postActions.ts | 2 +- src/model/Post.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/lib/actions/entityManagement/postActions.ts b/src/app/lib/actions/entityManagement/postActions.ts index e296048..d7574d2 100644 --- a/src/app/lib/actions/entityManagement/postActions.ts +++ b/src/app/lib/actions/entityManagement/postActions.ts @@ -23,7 +23,7 @@ export async function deletePost(postID: number): Promise> export async function getPosts(): Promise[]>> { 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))}; } diff --git a/src/model/Post.ts b/src/model/Post.ts index f1514e0..e519dc8 100644 --- a/src/model/Post.ts +++ b/src/model/Post.ts @@ -67,7 +67,7 @@ export class Post extends Model, InferCreationAttributes

; project: Association; - postBuckets: Association + buckets: Association postTags: Association; };