Update PAYLOAD_SERVER_URL to PAYLOAD_URL and remove unused env var

This commit is contained in:
Max Schmidt
2023-06-07 10:53:39 +02:00
parent fe5a99f370
commit 2c3b26a809
6 changed files with 18 additions and 19 deletions

View File

@ -2,7 +2,7 @@ import type { Post } from "../types";
const url = import.meta.env.DEV
? "http://payload:3001"
: `${import.meta.env.PAYLOAD_SERVER_URL}`;
: `${import.meta.env.PAYLOAD_URL}`;
export const getPosts = async () =>
(await (await fetch(`${url}/api/posts`)).json()).docs as Post[];