Added functionality to stop recreating tas of same name
This commit is contained in:
parent
166d556b6c
commit
ec63cde59b
@ -181,7 +181,6 @@ namespace Marco.Pms.Services.Helpers
|
|||||||
return ApiResponse<object>.SuccessResponse(list, System.String.Format("{0} contacts fetched successfully", list.Count), 200);
|
return ApiResponse<object>.SuccessResponse(list, System.String.Format("{0} contacts fetched successfully", list.Count), 200);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ApiResponse<object>> GetContactsListByBucketId(Guid id)
|
public async Task<ApiResponse<object>> GetContactsListByBucketId(Guid id)
|
||||||
{
|
{
|
||||||
Guid tenantId = _userHelper.GetTenantId();
|
Guid tenantId = _userHelper.GetTenantId();
|
||||||
@ -461,7 +460,6 @@ namespace Marco.Pms.Services.Helpers
|
|||||||
_logger.LogWarning("Employee with ID {LoggedInEmployeeId} sended empty payload", LoggedInEmployee.Id);
|
_logger.LogWarning("Employee with ID {LoggedInEmployeeId} sended empty payload", LoggedInEmployee.Id);
|
||||||
return ApiResponse<object>.ErrorResponse("User Send empty Payload", "User Send empty Payload", 400);
|
return ApiResponse<object>.ErrorResponse("User Send empty Payload", "User Send empty Payload", 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ApiResponse<object>> UpdateContact(Guid id, UpdateContactDto updateContact)
|
public async Task<ApiResponse<object>> UpdateContact(Guid id, UpdateContactDto updateContact)
|
||||||
{
|
{
|
||||||
Guid tenantId = _userHelper.GetTenantId();
|
Guid tenantId = _userHelper.GetTenantId();
|
||||||
@ -695,19 +693,7 @@ namespace Marco.Pms.Services.Helpers
|
|||||||
UpdateAt = DateTime.UtcNow
|
UpdateAt = DateTime.UtcNow
|
||||||
});
|
});
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
|
||||||
catch (DbUpdateException dbEx)
|
|
||||||
{
|
|
||||||
|
|
||||||
return ApiResponse<object>.ErrorResponse("User Send empty Payload", new
|
|
||||||
{
|
|
||||||
message = dbEx.Message,
|
|
||||||
innerexcption = dbEx.InnerException.Message
|
|
||||||
}, 400);
|
|
||||||
}
|
|
||||||
|
|
||||||
contact = await _context.Contacts.Include(c => c.ContactCategory).FirstOrDefaultAsync(c => c.Id == id && c.IsActive && c.TenantId == tenantId) ?? new Contact();
|
contact = await _context.Contacts.Include(c => c.ContactCategory).FirstOrDefaultAsync(c => c.Id == id && c.IsActive && c.TenantId == tenantId) ?? new Contact();
|
||||||
phones = await _context.ContactsPhones.AsNoTracking().Where(p => p.ContactId == contact.Id).ToListAsync();
|
phones = await _context.ContactsPhones.AsNoTracking().Where(p => p.ContactId == contact.Id).ToListAsync();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user