File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,18 @@ public async Task<IActionResult> Edit(Guid id)
251
251
return View ( provider ) ;
252
252
}
253
253
254
+ [ SelfHosted ( NotSelfHostedOnly = true ) ]
255
+ public async Task < IActionResult > Cancel ( Guid id )
256
+ {
257
+ var provider = await GetEditModel ( id ) ;
258
+ if ( provider == null )
259
+ {
260
+ return RedirectToAction ( "Index" ) ;
261
+ }
262
+
263
+ return RedirectToAction ( "Edit" , new { id } ) ;
264
+ }
265
+
254
266
[ HttpPost ]
255
267
[ ValidateAntiForgeryToken ]
256
268
[ SelfHosted ( NotSelfHostedOnly = true ) ]
Original file line number Diff line number Diff line change 19
19
<div class =" d-flex mt-4" >
20
20
<button type =" submit" class =" btn btn-primary" form =" edit-form" >Save</button >
21
21
<div class =" ms-auto d-flex" >
22
- <form asp-controller =" Providers" asp-action =" Edit " asp-route-id =" @Model.Provider.Id"
23
- onsubmit =" return confirm('Are you sure you want to cancel?')" >
22
+ <form asp-controller =" Providers" asp-action =" Cancel " asp-route-id =" @Model.Provider.Id"
23
+ onsubmit =" return confirm('Are you sure you want to cancel?')" >
24
24
<button class =" btn btn-outline-secondary" type =" submit" >Cancel</button >
25
25
</form >
26
26
</div >
You can’t perform that action at this time.
0 commit comments