Skip to content

Commit

Permalink
validations on endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald-pro committed May 14, 2024
1 parent 614bed3 commit c0bc356
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions routes/processes/nishauri_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,13 @@ router.get("/appointment_previous", async (req, res) => {

conn.end();
});
} catch (err) {}
} catch (err) {
return res.status(500).json({
success: false,
message: "An error occurred while processing the request."
});

}
});

//previous appointment list
Expand Down Expand Up @@ -1888,15 +1894,15 @@ router.get("/regimen", async (req, res) => {
}
);
} else {
return res.status(500).json({
return res.status(200).json({
success: false,
msg: "Regimen Records Found"
msg: "No Regimen records found, you are not registered to this program"
});
}
} else {
return res.status(500).json({
return res.status(200).json({
success: false,
msg: "Regimen Records Found"
msg: "No Regimen records found, you are not registered to this programr"
});
}
});
Expand Down Expand Up @@ -2683,7 +2689,7 @@ router.get(
});

let sql = `CALL sp_dawa_drop_appt(?)`;
let todo = [check_patient.clinic_number];
let todo = base64.decode(user_id);
conn.query(sql, todo, (error, results, fields) => {
if (error) {
return console.error(error.message);
Expand Down

0 comments on commit c0bc356

Please sign in to comment.