Fix bed management: preserve camaId from frontend to backend
- Use camaId generated in frontend instead of generating new one in backend API - Remove patientId and internacionId from cama table (use internaciones table instead) - Fix discharge: delete cama if fuera de area, mark available otherwise - Fix MapaCamas to find patient via internaciones table
This commit is contained in:
@@ -239,7 +239,10 @@ app.put('/api/camas/:id', async (req, res) => {
|
||||
|
||||
app.post('/api/camas', async (req, res) => {
|
||||
try {
|
||||
const cama = { ...req.body, id: generateUUID() };
|
||||
const cama = req.body;
|
||||
if (!cama.id) {
|
||||
cama.id = generateUUID();
|
||||
}
|
||||
await createCama(cama);
|
||||
res.json(cama);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user