diff options
author | crupest <crupest@outlook.com> | 2021-05-03 00:34:30 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-05-03 00:34:30 +0800 |
commit | 1c4be4a43c4acd2ee46e37685e9153d9c5b34233 (patch) | |
tree | 77b7b4a975fa0a9ec29235f8236f460cea358b94 /BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs | |
parent | 5eaf5c4e49dd87417886e20f1324b2f70396fa55 (diff) | |
download | timeline-1c4be4a43c4acd2ee46e37685e9153d9c5b34233.tar.gz timeline-1c4be4a43c4acd2ee46e37685e9153d9c5b34233.tar.bz2 timeline-1c4be4a43c4acd2ee46e37685e9153d9c5b34233.zip |
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs')
-rw-r--r-- | BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs b/BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs index a3da73fa..a7a5486c 100644 --- a/BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs +++ b/BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs @@ -16,6 +16,11 @@ namespace Timeline.Controllers return controller.StatusCode(StatusCodes.Status403Forbidden, new CommonResponse(ErrorCodes.Common.Forbid, message ?? Resource.MessageForbid));
}
+ public static ObjectResult Delete(this ControllerBase controller, bool delete = true)
+ {
+ return controller.StatusCode(StatusCodes.Status200OK, CommonDeleteResponse.Create(delete));
+ }
+
public static BadRequestObjectResult BadRequestWithCommonResponse(this ControllerBase controller, int code, string message)
{
return controller.BadRequest(new CommonResponse(code, message));
|