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