Lint errors
Signed-off-by: Rodrigo Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
1 parent
f993d9ebfc
commit
7a7e5a0ca1
3 files changed
+201
-17
No files matched your search
@@ -24,6 +24,10 @@ interface Agendamento {
|
||||
status: string;
|
||||
tipo?: string;
|
||||
observacoes?: string;
|
||||
atendimentoInicial?: {
|
||||
id: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
|
||||
export function AgendamentoCalendario() {
|
||||
@@ -40,9 +44,11 @@ export function AgendamentoCalendario() {
|
||||
|
||||
const loadAgendamentos = async (date: Date) => {
|
||||
try {
|
||||
const response = await api.get("/agendamentos", {
|
||||
console.log("Buscando agendamentos para a data:", date.toISOString());
|
||||
const response = await api.get("/atendimentos/agendamentos", {
|
||||
params: { data: date.toISOString() },
|
||||
});
|
||||
console.log("Resposta da API de agendamentos:", response.data);
|
||||
setAgendamentos(response.data);
|
||||
} catch (error) {
|
||||
console.error("Erro ao carregar agendamentos:", error);
|
||||
@@ -112,7 +118,7 @@ export function AgendamentoCalendario() {
|
||||
const handleDeleteAgendamento = async (id: string) => {
|
||||
if (window.confirm("Tem certeza que deseja excluir este agendamento?")) {
|
||||
try {
|
||||
await api.delete(`/agendamentos/${id}`);
|
||||
await api.delete(`/atendimentos/agendamentos/${id}`);
|
||||
await loadAgendamentos(selectedDate);
|
||||
} catch (error) {
|
||||
console.error("Erro ao excluir agendamento:", error);
|
||||
|
||||
@@ -84,7 +84,7 @@ export function AgendamentoForm({
|
||||
setIsSaving(true);
|
||||
if (agendamento) {
|
||||
// Atualizar agendamento existente
|
||||
await api.put(`/agendamentos/${agendamento.id}`, {
|
||||
await api.put(`/atendimentos/agendamentos/${agendamento.id}`, {
|
||||
clienteId,
|
||||
data: data.toISOString(),
|
||||
observacoes,
|
||||
@@ -92,7 +92,7 @@ export function AgendamentoForm({
|
||||
});
|
||||
} else {
|
||||
// Criar novo agendamento
|
||||
await api.post("/agendamentos", {
|
||||
await api.post("/atendimentos/agendamentos", {
|
||||
clienteId,
|
||||
data: data.toISOString(),
|
||||
observacoes,
|
||||
@@ -102,6 +102,7 @@ export function AgendamentoForm({
|
||||
onSave();
|
||||
onClose();
|
||||
} catch (error) {
|
||||
console.error("Erro ao salvar agendamento:", error);
|
||||
setError(
|
||||
agendamento
|
||||
? "Erro ao atualizar agendamento"
|
||||
|
||||
Reference in new issue
Block a user