#174 fixed
This commit is contained in:
parent
a0a22be220
commit
fd63183e76
@ -111,6 +111,11 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تغییر عنوان گروهی
|
||||
/// </summary>
|
||||
/// <param name="NamingModel"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IActionResult> OnPostAsync(GanjoorBatchNamingModel NamingModel)
|
||||
{
|
||||
await GetInformationAsync();
|
||||
@ -119,7 +124,7 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
{
|
||||
await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response);
|
||||
|
||||
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/renamepoems/{Cat.Cat.Id}", new StringContent(JsonConvert.SerializeObject(NamingModel), Encoding.UTF8, "application/json"));
|
||||
HttpResponseMessage response = await secureClient.PutAsync($"{APIRoot.Url}/api/ganjoor/cat/recaptionpoems/{Cat.Cat.Id}", new StringContent(JsonConvert.SerializeObject(NamingModel), Encoding.UTF8, "application/json"));
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
RenamingOutput = JsonConvert.DeserializeObject<string[]>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
@ -2827,6 +2827,8 @@ namespace RMuseum.Services.Implementation
|
||||
if (poems.Count == 0)
|
||||
return new RServiceResult<string[]>(new string[] { });
|
||||
|
||||
var catPage = await _context.GanjoorPages.Where(p => p.GanjoorPageType == GanjoorPageType.CatPage && p.CatId == catId).SingleAsync();
|
||||
|
||||
if(model.RemovePreviousPattern)
|
||||
{
|
||||
char[] numbers = "0123456789۰۱۲۳۴۵۶۷۸۹".ToArray();
|
||||
@ -2880,6 +2882,8 @@ namespace RMuseum.Services.Implementation
|
||||
{
|
||||
poems[i].Title = $"{model.StartWithNotIncludingSpaces} {(i + 1).ToPersianNumbers()}";
|
||||
}
|
||||
|
||||
poems[i].FullTitle = $"{catPage.FullTitle} » {poems[i].Title}";
|
||||
|
||||
}
|
||||
|
||||
@ -2889,6 +2893,7 @@ namespace RMuseum.Services.Implementation
|
||||
{
|
||||
var page = await _context.GanjoorPages.Where(p => p.Id == poem.Id).SingleAsync();
|
||||
page.Title = poem.Title;
|
||||
page.FullTitle = poem.FullTitle;
|
||||
_context.GanjoorPages.Update(page);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user