This commit is contained in:
Hamid Reza Mohammadi 2024-05-10 18:56:39 +03:30
parent f50c4286d7
commit f248ae8443
2 changed files with 22 additions and 0 deletions

View File

@ -1261,5 +1261,26 @@ namespace GanjooRazor.Pages
return GanjoorPage != null && GanjoorPage.Poem != null && GanjoorPage.Poem.ClaimedByMultiplePoets ? "poem ribbon-parent" : "poem";
}
}
public async Task<ActionResult> OnPostMarkAsTextOriginalAsync(int bookId, int categoryId)
{
using (HttpClient secureClient = new HttpClient())
{
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
{
HttpResponseMessage response = await secureClient.PutAsync(
$"{APIRoot.Url}/api/ganjoor/naskban/textoriginal/{bookId}/{categoryId}/true", null);
if (!response.IsSuccessStatusCode)
{
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
}
return new OkObjectResult(true);
}
else
{
return new BadRequestObjectResult("لطفاً از گنجور خارج و مجددا به آن وارد شوید.");
}
}
}
}
}

View File

@ -226,6 +226,7 @@ namespace RMuseum.Services.Implementation
{
var poems = await context.GanjoorPoems.AsNoTracking().Where(p => p.CatId == catId).ToListAsync();
poemCount += poems.Count;
progress++;
foreach (var poem in poems)
{
if (textOriginal)