added api to get list of contact tag

This commit is contained in:
Pramod Mahajan 2025-05-15 18:52:43 +05:30 committed by ashutosh.nehete
parent d294bcef44
commit ddc6f9e393

View File

@ -143,23 +143,6 @@ namespace Marco.Pms.Services.Helpers
_logger.LogWarning("Employee {EmployeeId} tries to delete Category {CategoryId} but not found in database", LoggedInEmployee.Id, id);
return ApiResponse<object>.SuccessResponse(new { }, "Category deleted successfully", 200);
}
public async Task<ApiResponse<object>> GetContactCategoriesList()
{
Guid tenantId = _userHelper.GetTenantId();
var LoggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
var categoryList = await _context.ContactCategoryMasters.Where(c => c.TenantId == tenantId).ToListAsync();
List<ContactCategoryVM> contactCategories = new List<ContactCategoryVM>();
foreach (var category in categoryList)
{
ContactCategoryVM categoryVM = category.ToContactCategoryVMFromContactCategoryMaster();
contactCategories.Add(categoryVM);
}
_logger.LogInfo("{count} contact categoires are fetched by Employee with ID {LoggedInEmployeeId}", contactCategories.Count, LoggedInEmployee.Id);
return ApiResponse<object>.SuccessResponse(contactCategories, System.String.Format("{0} contact categories fetched successfully", contactCategories.Count), 200);
}
// -------------------------------- Contact Tag --------------------------------