docs: #352 retrieving cateogory poems geo tags in the UI

This commit is contained in:
Hamid Reza Mohammadi 2022-08-03 13:00:20 +04:30
parent c121a9c2d1
commit 260b1a638f

View File

@ -305,6 +305,12 @@ namespace GanjooRazor.Pages
/// </summary>
public bool ShowAllRecitaions { get; set; }
/// <summary>
/// category poem geo date tags
/// </summary>
public PoemGeoDateTag[] CategoryPoemGeoDateTags { get; set; }
/// <summary>
/// prepare poem except
/// </summary>
@ -782,6 +788,18 @@ namespace GanjooRazor.Pages
ViewData["BrearCrumpList"] = breadCrumbList.ToString();
if(IsCatPage)
{
var tagsResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/{GanjoorPage.PoetOrCat.Cat.Id}/geotag");
if (!tagsResponse.IsSuccessStatusCode)
{
LastError = JsonConvert.DeserializeObject<string>(await tagsResponse.Content.ReadAsStringAsync());
return Page();
}
CategoryPoemGeoDateTags = JsonConvert.DeserializeObject<PoemGeoDateTag[]>(await tagsResponse.Content.ReadAsStringAsync());
}
return Page();
}