Support sub-path deploy via NEXT_PUBLIC_BASE_PATH (loma.chat/pagiva)
Adds basePath config, withBase/appUrl helpers, base-path-aware cookies, OAuth redirects, manifest, service worker and cron runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { withBase } from "@/lib/base-path";
|
||||
|
||||
/* eslint-disable @next/next/no-img-element -- Blob URLs and Graph CDN images, not optimisable */
|
||||
import { useRef, useState } from "react";
|
||||
@@ -124,7 +125,7 @@ export function PostEditor({
|
||||
setBusy(label);
|
||||
setError(null);
|
||||
try {
|
||||
const res = await fetch(url, { ...init, headers: init.body instanceof FormData ? undefined : { "Content-Type": "application/json" } });
|
||||
const res = await fetch(withBase(url), { ...init, headers: init.body instanceof FormData ? undefined : { "Content-Type": "application/json" } });
|
||||
const body = await res.json().catch(() => ({}));
|
||||
if (!res.ok) {
|
||||
setError(body.error ?? "ทำรายการไม่สำเร็จ");
|
||||
|
||||
Reference in New Issue
Block a user