search: validate catId based on poetId

This commit is contained in:
Hamid Reza Mohammadi 2025-03-17 21:16:31 +03:30
parent 6f4c14f256
commit 57fae5f53a

View File

@ -2800,6 +2800,14 @@ namespace RMuseum.Services.Implementation
{
catId = null;
}
if (poetId != null && catId != null)
{
var cat = await _context.GanjoorCategories.AsNoTracking().Where(c => c.Id == catId).SingleAsync();
if(cat.PoetId != poetId)
{
catId = null;
}
}
if (poetId != null && catId == null)
{
var poetRes = await GetPoetById((int)poetId);