clean mundex pages cache within music suggestion review page
This commit is contained in:
parent
9094dd7511
commit
fde2ec4ccf
@ -181,5 +181,7 @@ else
|
||||
|
||||
<p><a role="button" onclick="rebuildMundex()" class="actionlink" title="بازسازی صفحات نمایهٔ موسیقی">بازسازی صفحات نمایهٔ موسیقی</a></p>
|
||||
|
||||
<p><a role="button" onclick="cleanMundexCache()" class="actionlink" title="حذف کش صفحات نمایهٔ موسیقی">حذف کش صفحات نمایهٔ موسیقی</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -166,5 +166,23 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
}
|
||||
return new OkObjectResult(false);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostCleanMundexCacheAsync()
|
||||
{
|
||||
using (HttpClient secureClient = new HttpClient())
|
||||
{
|
||||
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
|
||||
{
|
||||
HttpResponseMessage response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/page/cache/64899");// =>/mundex
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
response = await secureClient.DeleteAsync($"{APIRoot.Url}/api/ganjoor/page/cache/70833");// =>mundex/bypoet
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
return new OkObjectResult(true);
|
||||
}
|
||||
}
|
||||
return new OkObjectResult(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,6 +147,25 @@
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function cleanMundexCache() {
|
||||
if (!confirm('آیا از حذف کش صفحات موسیقی اطمینان دارید؟'))
|
||||
return;
|
||||
|
||||
var url = '?handler=CleanMundexCache';
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
error: function () {
|
||||
alert('خطا رخ داد.')
|
||||
},
|
||||
success: function () {
|
||||
alert('کش صفخات پاک شد.')
|
||||
},
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user