#85 changing moderation api from DELETE to POST

This commit is contained in:
Hamid Reza Mohammadi 2021-03-12 10:39:16 +03:30
parent 604ecacb2f
commit d50bd8054d
2 changed files with 6 additions and 5 deletions

View File

@ -629,13 +629,13 @@ namespace RMuseum.Controllers
/// <param name="id"></param>
/// <param name="reason"></param>
/// <returns></returns>
[HttpDelete]
[Route("comment/moderate")]
[HttpPost]
[Route("comment/moderate/{id}")]
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + RMuseumSecurableItem.ModerateOperationShortName)]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
[ProducesResponseType((int)HttpStatusCode.Forbidden)]
public async Task<IActionResult> DeleteModerateComment(int id, string reason)
public async Task<IActionResult> DeleteModerateComment(int id, [FromBody]string reason)
{
var res =

View File

@ -606,11 +606,12 @@ namespace RMuseum.Services.Implementation
if (comment.UserId != null)
{
reason = string.IsNullOrEmpty(reason) ? "" : $"علت ارائه شده برای حذف یا متن گزارش کاربر شاکی: {Environment.NewLine}" +
$"{reason} {Environment.NewLine}";
await _notificationService.PushNotification((Guid)comment.UserId,
"حذف حاشیهٔ شما",
$"حاشیهٔ شما به دلیل ناسازگاری با قوانین حاشیه‌گذاری گنجور و طبق گزارشات دیگر کاربران حذف شده است..{Environment.NewLine}" +
$"علت ارائه شده برای حذف: {Environment.NewLine}" +
$"{reason} {Environment.NewLine}" +
$"{reason}" +
$"این متن حاشیهٔ حذف شدهٔ شماست: {Environment.NewLine}" +
$"{comment.HtmlComment}"
);