Skip to content

Commit

Permalink
Allow ART program setup for only one user per a given ccc no
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald-pro committed May 21, 2024
1 parent 58c583f commit f3d168e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions routes/processes/nishauri_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ router.post(
}
});


if (!check_valid_user) {
return res.status(200).json({
success: false,
Expand Down Expand Up @@ -899,16 +900,30 @@ router.post(
]
}
});
let check_art_user = await NUserprograms.findOne({
where: {
[Op.and]: [
{ program_identifier: { [Op.ne]: check_program_valid.id } },
{ user_id: base64.decode(user_id) },
{ program_type: program_id }
]
}
});


if (check_art_user) {
return res.status(200).json({
success: false,
msg: `The ART Program details does not belong to your records`
});
}
if (check_program) {
return res.status(200).json({
success: false,
msg: "Program registration record already exists"
});
//Update Login & Active Login

} else if (existing_other_program) {

if (!check_program_valid) {
return res.status(200).json({
success: false,
Expand Down

0 comments on commit f3d168e

Please sign in to comment.