various changes
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
cache: 'no-store'
|
||||
|
||||
import { tryFetchPosts } from "@/app/api/post/route";
|
||||
import { Post } from "@/model/Post";
|
||||
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 { getProjects } from "@/app/lib/actions/entityManagement/projectActions";
|
||||
import { Project } from "@/model/Project";
|
||||
import { Bucket, Project, Post, dbSync, Attachment } from "@/model/Models";
|
||||
|
||||
type Props = {
|
||||
children?:ReactNode
|
||||
@@ -16,6 +15,8 @@ type Props = {
|
||||
|
||||
|
||||
export default async function PostView(props:Props){
|
||||
await dbSync;
|
||||
|
||||
const headings = [
|
||||
'#',
|
||||
'Title',
|
||||
@@ -32,7 +33,8 @@ export default async function PostView(props:Props){
|
||||
getProjects,
|
||||
savePost:updatePost
|
||||
};
|
||||
const posts:Post[] = await Post.findAll().then(posts=>posts.map((e)=>JSON.parse(JSON.stringify(e))));
|
||||
|
||||
const posts:Post[] = await Post.findAll({include: {model: Bucket, include: {model: Attachment}}}).then(posts=>posts.map((e)=>JSON.parse(JSON.stringify(e))));
|
||||
const projects = await Project.findAll().then(projects=>projects.map((e)=>JSON.parse(JSON.stringify(e))));
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user