Fixed error when including buckets on post query
This commit is contained in:
@@ -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))};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user