Compare commits

..

No commits in common. "64e4525fcf13ab8529565e35e7dc39e3bd175711" and "e97a83e7c054e73f9aff9b0cb79d9391dacfffff" have entirely different histories.

2 changed files with 3 additions and 30 deletions

View File

@ -680,7 +680,7 @@ namespace Marco.Pms.Services.Controllers
return Ok(response);
}
[HttpGet("contact-category/{id}")]
[HttpGet("contact-category/{id})")]
public async Task<IActionResult> GetContactCategoryMaster(Guid id)
{
return Ok();
@ -726,7 +726,7 @@ namespace Marco.Pms.Services.Controllers
return Ok(response);
}
[HttpGet("contact-tag/{id}")]
[HttpGet("contact-tag/{id})")]
public async Task<IActionResult> GetContactTagMaster(Guid id)
{
return Ok();
@ -768,8 +768,7 @@ namespace Marco.Pms.Services.Controllers
[HttpDelete("contact-tag/{id}")]
public async Task<IActionResult> DeletecontactTagMaster(Guid id)
{
var response = await _masterHelper.DeleteContactTag(id);
return Ok(response);
return Ok();
}
}
}

View File

@ -139,33 +139,7 @@ namespace Marco.Pms.Services.Helpers
_logger.LogWarning("Employee with ID {LoggedInEmployeeId} sended empty payload", LoggedInEmployee.Id);
return ApiResponse<object>.ErrorResponse("User Send empty Payload", "User Send empty Payload", 400);
}
public async Task<ApiResponse<object>> DeleteContactTag(Guid id)
{
Guid tenantId = _userHelper.GetTenantId();
var LoggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
ContactTagMaster? contactTag = await _context.ContactTagMasters.FirstOrDefaultAsync(c => c.Id == id && c.TenantId == tenantId);
if (contactTag != null)
{
List<ContactTagMapping>? tagMappings = await _context.ContactTagMappings.Where(t => t.ContactTagtId == contactTag.Id).ToListAsync();
_context.ContactTagMasters.Remove(contactTag);
if (tagMappings.Any())
{
_context.ContactTagMappings.RemoveRange(tagMappings);
}
_context.DirectoryUpdateLogs.Add(new DirectoryUpdateLog
{
RefereanceId = id,
UpdatedById = LoggedInEmployee.Id,
UpdateAt = DateTime.UtcNow
});
await _context.SaveChangesAsync();
_logger.LogInfo("Employee {EmployeeId} deleted contact tag {ContactTagId}", LoggedInEmployee.Id, id);
}
_logger.LogWarning("Employee {EmployeeId} tries to delete Tag {ContactTagId} but not found in database", LoggedInEmployee.Id, id);
return ApiResponse<object>.SuccessResponse(new { }, "Tag deleted successfully", 200);
}
}
}