develop #83

Merged
M-Gabrielly merged 426 commits from develop into main 2025-12-04 04:13:15 +00:00
3 changed files with 8 additions and 8 deletions
Showing only changes of commit a1f8a7995c - Show all commits

View File

@ -177,7 +177,7 @@ export default function PacientesPage() {
<PatientRegistrationForm
inline
mode={editingId ? "edit" : "create"}
patientId={editingId ? Number(editingId) : null}
patientId={editingId}
onSaved={handleSaved}
onClose={() => setShowForm(false)}
/>

View File

@ -37,7 +37,7 @@ type Mode = "create" | "edit";
export interface PatientRegistrationFormProps {
open?: boolean;
onOpenChange?: (open: boolean) => void;
patientId?: number | null;
patientId?: string | number | null;
inline?: boolean;
mode?: Mode;
onSaved?: (paciente: Paciente) => void;
@ -112,7 +112,9 @@ export function PatientRegistrationForm({
async function load() {
if (mode !== "edit" || patientId == null) return;
try {
console.log("[PatientForm] Carregando paciente ID:", patientId);
const p = await buscarPacientePorId(String(patientId));
console.log("[PatientForm] Dados recebidos:", p);
setForm((s) => ({
...s,
nome: p.full_name || "", // 👈 trocar nome → full_name
@ -133,13 +135,10 @@ export function PatientRegistrationForm({
observacoes: p.notes || "",
}));
const ax = await listarAnexos(String(patientId)).catch(() => []);
setServerAnexos(Array.isArray(ax) ? ax : []);
} catch {
} catch (err) {
console.error("[PatientForm] Erro ao carregar paciente:", err);
}
}
load();

View File

@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.