Fixed Type Issues

This commit is contained in:
2024-06-24 02:58:26 +02:00
parent 39f3c02e7c
commit 92bdb03836
6 changed files with 76 additions and 38 deletions
@@ -5,9 +5,10 @@ import { constructAPIUrl } from "@/util/Utils";
import { ReactNode, useEffect } from "react";
import TableGen from "../../../client/TableGen";
import PostTable from "@/components/client/admin/PostTable";
import { deletePost, getPosts, updatePost } from "@/app/lib/actions/entityManagement/postActions";
import { deletePost, getPostsWithBuckets, updatePost } from "@/app/lib/actions/entityManagement/postActions";
import { getProjects } from "@/app/lib/actions/entityManagement/projectActions";
import { Bucket, Project, Post, dbSync, Attachment } from "@/model/Models";
import { tryCreateAttachment } from "@/app/api/attachment/route";
type Props = {
children?:ReactNode
@@ -29,9 +30,10 @@ export default async function PostView(props:Props){
]
const actions = {
deletePost: deletePost,
getPosts:getPosts, getProjects:
getProjects,
savePost:updatePost
getPosts:getPostsWithBuckets,
getProjects:getProjects,
savePost:updatePost,
// uploadAttachment:tryCreateAttachment
};
const posts:Post[] = await Post.findAll({include: {model: Bucket, include: {model: Attachment}}}).then(posts=>posts.map((e)=>JSON.parse(JSON.stringify(e))));