Fix API path in category fetch calls by removing leading slash

This commit is contained in:
Bram Suurd 2024-11-05 00:20:10 +01:00
parent 1a412bce38
commit 2f9f51ec7c
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ function ScriptContent() {
useEffect(() => { useEffect(() => {
fetch( fetch(
`/api/categories?_=${process.env.NEXT_PUBLIC_BUILD_TIME || Date.now()}`, `api/categories?_=${process.env.NEXT_PUBLIC_BUILD_TIME || Date.now()}`,
) )
.then((response) => response.json()) .then((response) => response.json())
.then((categories) => { .then((categories) => {

View File

@ -53,7 +53,7 @@ export default function CommandMenu() {
const fetchCategories = async () => { const fetchCategories = async () => {
setIsLoading(true); setIsLoading(true);
fetch( fetch(
`/api/categories?_=${process.env.NEXT_PUBLIC_BUILD_TIME || Date.now()}`, `api/categories?_=${process.env.NEXT_PUBLIC_BUILD_TIME || Date.now()}`,
) )
.then((response) => response.json()) .then((response) => response.json())
.then((categories) => { .then((categories) => {