Solucionar rutas API de otros laboratorios, ajuste de servidor y modal de confirmacion para eliminar registros
This commit is contained in:
@@ -753,7 +753,7 @@ const actualizarInternacion = useCallback(async (internacionId: string, datos: P
|
||||
id: generateUUID(),
|
||||
};
|
||||
try {
|
||||
await apiCall('POST', '/api/otros-laboratorios', nuevo);
|
||||
await apiCall('POST', '/otros-laboratorios', nuevo);
|
||||
setState(prev => ({
|
||||
...prev,
|
||||
otrosLaboratorios: [...prev.otrosLaboratorios, nuevo],
|
||||
@@ -767,7 +767,7 @@ const actualizarInternacion = useCallback(async (internacionId: string, datos: P
|
||||
|
||||
const eliminarOtroLaboratorio = useCallback(async (id: string) => {
|
||||
try {
|
||||
await apiCall('DELETE', `/api/otros-laboratorios/${id}`);
|
||||
await apiCall('DELETE', `/otros-laboratorios/${id}`);
|
||||
setState(prev => ({
|
||||
...prev,
|
||||
otrosLaboratorios: prev.otrosLaboratorios.filter(o => o.id !== id),
|
||||
@@ -780,7 +780,7 @@ const actualizarInternacion = useCallback(async (internacionId: string, datos: P
|
||||
|
||||
const actualizarOtroLaboratorio = useCallback(async (id: string, datos: Partial<OtroLaboratorio>) => {
|
||||
try {
|
||||
await apiCall('PUT', `/api/otros-laboratorios/${id}`, datos);
|
||||
await apiCall('PUT', `/otros-laboratorios/${id}`, datos);
|
||||
setState(prev => ({
|
||||
...prev,
|
||||
otrosLaboratorios: prev.otrosLaboratorios.map(o => o.id === id ? { ...o, ...datos } : o),
|
||||
|
||||
Reference in New Issue
Block a user