s''
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { Link } from "@/i18n/navigation";
|
||||
import { apiUrl } from "@/app/lib/api-client";
|
||||
|
||||
const DEFAULT_PASSWORD = "12345678";
|
||||
|
||||
@@ -33,7 +34,7 @@ export default function JoinPaidPage() {
|
||||
let cancelled = false;
|
||||
|
||||
const tryComplete = async (orderId: string): Promise<{ ok: boolean; error?: string }> => {
|
||||
const r = await fetch("/api/meetup/complete-order", {
|
||||
const r = await fetch(apiUrl("/api/meetup/complete-order"), {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ order_id: orderId }),
|
||||
@@ -43,7 +44,7 @@ export default function JoinPaidPage() {
|
||||
if (!d?.ok) return { ok: false, error: d?.error || `HTTP ${r.status}` };
|
||||
|
||||
if (d?.token && d?.record) {
|
||||
await fetch("/api/auth/sync-session", {
|
||||
await fetch(apiUrl("/api/auth/sync-session"), {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ token: d.token, record: d.record }),
|
||||
@@ -59,13 +60,13 @@ export default function JoinPaidPage() {
|
||||
window.dispatchEvent(new CustomEvent("vip:updated"));
|
||||
}, 400);
|
||||
if (d.is_new) {
|
||||
await fetch("/api/meetup/set-needs-password-change", { method: "POST", credentials: "include" });
|
||||
await fetch(apiUrl("/api/meetup/set-needs-password-change"), { method: "POST", credentials: "include" });
|
||||
if (!cancelled) {
|
||||
setNeedPasswordChange(true);
|
||||
setShowPasswordModal(true);
|
||||
}
|
||||
} else {
|
||||
const needRes = await fetch("/api/meetup/need-password-change", { credentials: "include" });
|
||||
const needRes = await fetch(apiUrl("/api/meetup/need-password-change"), { credentials: "include" });
|
||||
const needData = await needRes.json().catch(() => ({}));
|
||||
if (!cancelled && needData?.need === true) {
|
||||
setNeedPasswordChange(true);
|
||||
@@ -121,7 +122,7 @@ export default function JoinPaidPage() {
|
||||
setErrorDetail(lastError);
|
||||
}
|
||||
|
||||
fetch("/api/meetup/need-password-change")
|
||||
fetch(apiUrl("/api/meetup/need-password-change"))
|
||||
.then((res) => res.json())
|
||||
.then((d) => {
|
||||
if (cancelled) return;
|
||||
@@ -166,7 +167,7 @@ export default function JoinPaidPage() {
|
||||
}
|
||||
setChanging(true);
|
||||
try {
|
||||
const res = await fetch("/api/auth/change-password", {
|
||||
const res = await fetch(apiUrl("/api/auth/change-password"), {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ newPassword, passwordConfirm }),
|
||||
|
||||
Reference in New Issue
Block a user