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";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -29,7 +30,7 @@ export function AccountForm({ initial }: { initial: { name: string; email: strin
|
||||
form.set("removeAvatar", String(removeAvatar));
|
||||
if (file) form.set("avatar", file);
|
||||
try {
|
||||
const response = await fetch("/api/account", { method: "PUT", body: form });
|
||||
const response = await fetch(withBase("/api/account"), { method: "PUT", body: form });
|
||||
const json = await response.json().catch(() => ({}));
|
||||
if (!response.ok) throw new Error(json.error ?? "บันทึกไม่สำเร็จ");
|
||||
toast.show("บันทึกโปรไฟล์แล้ว");
|
||||
|
||||
Reference in New Issue
Block a user