File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,25 @@ module.exports = router => {
4949 } )
5050 } )
5151
52+ // Action to mark organisation as accepted
53+ router . post ( '/regions/accepted/:id' , ( req , res ) => {
54+ const data = req . session . data
55+ const organisation = data . organisations . find ( ( org ) => org . id === req . params . id )
56+ organisation . status = 'Active'
57+
58+ res . redirect ( '/regions/awaiting-approval' )
59+ } )
60+
61+ // Action to mark organisation as rejected
62+ router . post ( '/regions/rejected/:id' , ( req , res ) => {
63+ const data = req . session . data
64+ const organisation = data . organisations . find ( ( org ) => org . id === req . params . id )
65+ organisation . status = 'Rejected'
66+
67+ res . redirect ( '/regions/awaiting-approval' )
68+ } )
69+
70+
5271 router . get ( '/regions/reject/:id' , ( req , res ) => {
5372 const data = req . session . data
5473 const organisation = data . organisations . find ( ( org ) => org . id === req . params . id )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ <h1 class="nhsuk-heading-l">Approve {{ organisation.name }}</h1>
3333 {% include "regions/_email-preview.html" %}
3434
3535
36- < form action ="/regions/awaiting-approval " method ="post " novalidate ="true ">
36+ < form action ="/regions/accepted/{{ organisation.id }} " method ="post " novalidate ="true ">
3737 {{ button({
3838 "text": "Confirm and send",
3939 classes: "nhsuk-button"
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ <h1 class="nhsuk-heading-l">Reject {{ organisation.name }}</h1>
2828
2929 {% include "regions/_email-reject.html" %}
3030
31- < form action ="/regions/awaiting-approval " method ="post " novalidate ="true ">
31+ < form action ="/regions/rejected/{{ organisation.id }} " method ="post " novalidate ="true ">
3232 {{ button({
3333 "text": "Confirm and send",
3434 classes: "nhsuk-button--warning"
You can’t perform that action at this time.
0 commit comments