8.8 제휴업소 요청: 요청 생성/승인/상태 관리/이력 o

This commit is contained in:
koreacomp5
2025-10-09 17:45:34 +09:00
parent 66a68c2bfa
commit 8f4446a87a
7 changed files with 93 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
"use client";
import { useState } from "react";
export default function PartnerRequestPage() {
const [form, setForm] = useState({ name: "", category: "spa", latitude: "", longitude: "", address: "", contact: "" });
const [done, setDone] = useState(false);
async function submit() {
const r = await fetch("/api/partner-requests", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ ...form, latitude: Number(form.latitude), longitude: Number(form.longitude) }) });
setDone(r.ok);
}
if (done) return <div> . .</div>;
return (
<div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
<h1> </h1>
<input placeholder="업체명" value={form.name} onChange={(e) => setForm({ ...form, name: e.target.value })} />
<input placeholder="카테고리(spa/gym 등)" value={form.category} onChange={(e) => setForm({ ...form, category: e.target.value })} />
<input placeholder="위도" value={form.latitude} onChange={(e) => setForm({ ...form, latitude: e.target.value })} />
<input placeholder="경도" value={form.longitude} onChange={(e) => setForm({ ...form, longitude: e.target.value })} />
<input placeholder="주소(선택)" value={form.address} onChange={(e) => setForm({ ...form, address: e.target.value })} />
<input placeholder="연락처(선택)" value={form.contact} onChange={(e) => setForm({ ...form, contact: e.target.value })} />
<button onClick={submit}></button>
</div>
);
}