@ -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) => {
|
||||
|
7
astro/src/utils/payload.ts
Normal file
7
astro/src/utils/payload.ts
Normal 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;
|
Reference in New Issue
Block a user