Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
Max Schmidt
2023-05-15 17:38:17 +02:00
parent acda6ea8c0
commit d8c1f15c91
6 changed files with 33 additions and 26 deletions

View File

@ -1,8 +1,4 @@
import {
payloadSlateToDomConfig,
SlateToDomConfig,
slateToHtml,
} from "slate-serializers";
import { payloadSlateToDomConfig, slateToHtml } from "slate-serializers";
import { Element } from "domhandler";
export const getContentArray = (content: any) => {

View File

@ -0,0 +1,7 @@
import type { Post } from "../types";
export const getPosts = async () =>
(await (await fetch("http://payload:3001/api/posts")).json()).docs as Post[];
export const getPost = async (id: string) =>
(await (await fetch(`http://payload:3001/api/posts/${id}`)).json()) as Post;