aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Filters
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-28 00:01:04 +0800
committercrupest <crupest@outlook.com>2020-08-28 00:01:04 +0800
commit12410a51fb2e5f55e8d83415bc3c4053a146ce3b (patch)
tree920ef556df34e0d69d990f8bf3ef2fdce13f9f46 /Timeline/Filters
parentc10dc9e221317ea39f9ce0f172670ffbe94e6f8a (diff)
downloadtimeline-12410a51fb2e5f55e8d83415bc3c4053a146ce3b.tar.gz
timeline-12410a51fb2e5f55e8d83415bc3c4053a146ce3b.tar.bz2
timeline-12410a51fb2e5f55e8d83415bc3c4053a146ce3b.zip
Add change timeline name api to timeline controller.
Diffstat (limited to 'Timeline/Filters')
-rw-r--r--Timeline/Filters/Timeline.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/Timeline/Filters/Timeline.cs b/Timeline/Filters/Timeline.cs
index 90b87223..6a730ee7 100644
--- a/Timeline/Filters/Timeline.cs
+++ b/Timeline/Filters/Timeline.cs
@@ -1,4 +1,5 @@
-using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Timeline.Models.Http;
using Timeline.Services.Exceptions;
@@ -13,11 +14,17 @@ namespace Timeline.Filters
{
if (e.InnerException is UserNotExistException)
{
- context.Result = new NotFoundObjectResult(ErrorResponse.UserCommon.NotExist());
+ if (HttpMethods.IsGet(context.HttpContext.Request.Method))
+ context.Result = new NotFoundObjectResult(ErrorResponse.UserCommon.NotExist());
+ else
+ context.Result = new BadRequestObjectResult(ErrorResponse.UserCommon.NotExist());
}
else
{
- context.Result = new NotFoundObjectResult(ErrorResponse.TimelineController.NotExist());
+ if (HttpMethods.IsGet(context.HttpContext.Request.Method))
+ context.Result = new NotFoundObjectResult(ErrorResponse.TimelineController.NotExist());
+ else
+ context.Result = new BadRequestObjectResult(ErrorResponse.TimelineController.NotExist());
}
}
}