Compare commits
No commits in common. "094640bffb2ae95d297b79d710b8aaa22eea0e7e" and "a30ec6f952a7ca052156af18558d065980825c40" have entirely different histories.
094640bffb
...
a30ec6f952
|
|
@ -14,7 +14,6 @@ CREATE TABLE IF NOT EXISTS plans (
|
|||
name VARCHAR(100) NOT NULL,
|
||||
slug VARCHAR(100) UNIQUE NOT NULL,
|
||||
description TEXT,
|
||||
price NUMERIC(10,2) NOT NULL DEFAULT 0,
|
||||
price_monthly NUMERIC(10,2) NOT NULL DEFAULT 0,
|
||||
price_yearly NUMERIC(10,2) NOT NULL DEFAULT 0,
|
||||
max_professionals INT NOT NULL DEFAULT 1,
|
||||
|
|
@ -202,7 +201,6 @@ CREATE TABLE IF NOT EXISTS appointments (
|
|||
notes TEXT,
|
||||
client_name VARCHAR(200), -- for walk-ins
|
||||
client_phone VARCHAR(20),
|
||||
client_email VARCHAR(200),
|
||||
source VARCHAR(20) DEFAULT 'manual', -- manual, online, whatsapp
|
||||
cancelled_at TIMESTAMPTZ,
|
||||
cancellation_reason TEXT,
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ export default function Agenda() {
|
|||
const [newDate, setNewDate] = useState(today.toISOString().split('T')[0]);
|
||||
const [newTime, setNewTime] = useState('10:00');
|
||||
const [newNotes, setNewNotes] = useState('');
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (professionals.length > 0 && !newProf) {
|
||||
|
|
@ -248,8 +247,8 @@ export default function Agenda() {
|
|||
</div>
|
||||
</div>
|
||||
<div className="modal-footer">
|
||||
<button className="btn btn-secondary" disabled={submitting} onClick={() => setShowModal(false)}>Cancelar</button>
|
||||
<button className="btn btn-primary" disabled={submitting} onClick={async () => {
|
||||
<button className="btn btn-secondary" onClick={() => setShowModal(false)}>Cancelar</button>
|
||||
<button className="btn btn-primary" onClick={async () => {
|
||||
const [h, m] = newTime.split(':').map(Number);
|
||||
const selectedSvc = services.find(s => s.id === newService);
|
||||
|
||||
|
|
@ -259,7 +258,6 @@ export default function Agenda() {
|
|||
|
||||
const slug = localStorage.getItem('agendapro_tenant_slug') || 'barbearia-premium';
|
||||
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const res = await fetch('/api/tenant/agenda', {
|
||||
method: 'POST',
|
||||
|
|
@ -290,10 +288,8 @@ export default function Agenda() {
|
|||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
}}>{submitting ? 'Agendando...' : 'Agendar'}</button>
|
||||
}}>Agendar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue