Refactoring

This commit is contained in:
2024-06-25 11:32:06 +02:00
parent 1e8a12789d
commit a492bf4ac0
7 changed files with 36 additions and 45 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ import { useState } from "react";
import { Project, Post, Bucket } from "@/model/Models";
import { ActionResult } from "@/app/lib/actions/ActionResult";
import { handleActionResult } from "@/app/lib/actions/clientActionHandler";
import { getPostsWithBuckets } from "@/app/lib/actions/entityManagement/postActions";
import { getPostsWithBucketsAndProject } from "@/app/lib/actions/entityManagement/postActions";
import { PostAttributesWithBuckets } from "@/model/Post";
type Actions = {
@@ -100,7 +100,7 @@ export default function PostTable(props: Props) {
project_id: e.project_id
})
.then(res => handleActionResult(res))
.then(getPostsWithBuckets)
.then(getPostsWithBucketsAndProject)
.then(res => {
if (!res.error && res.result) setPosts(res.result);
})
@@ -169,7 +169,7 @@ export default function PostTable(props: Props) {
}
return <>
<EntityManagementTable key="der-table" headings={props.headings}>
<EntityManagementTable entityName="Post" key="der-table" headings={props.headings}>
{posts.map((postData: Partial<PostAttributesWithBuckets>) => <TableRow headings={props.headings}
postData={postData}
key={postData.id}/> )}