Added new logs in expense update API
This commit is contained in:
parent
eaf6284a57
commit
a7392a515d
@ -824,12 +824,12 @@ namespace Marco.Pms.Services.Service
|
|||||||
|
|
||||||
if (existingExpense.StatusId != Draft && existingExpense.StatusId != RejectedByReviewer && existingExpense.StatusId != RejectedByApprover)
|
if (existingExpense.StatusId != Draft && existingExpense.StatusId != RejectedByReviewer && existingExpense.StatusId != RejectedByApprover)
|
||||||
{
|
{
|
||||||
_logger.LogWarning("User attempted to update expense with ID {ExpenseId}, but donot have status of DRAFT or REJECTED", loggedInEmployee.Id);
|
_logger.LogWarning("User attempted to update expense with ID {ExpenseId}, but donot have status of DRAFT or REJECTED, but is {StatusId}", existingExpense.Id, existingExpense.StatusId);
|
||||||
return ApiResponse<object>.ErrorResponse("Expense connot be updated", "Expense connot be updated", 400);
|
return ApiResponse<object>.ErrorResponse("Expense connot be updated", "Expense connot be updated", 400);
|
||||||
}
|
}
|
||||||
if (existingExpense.CreatedById != loggedInEmployee.Id)
|
if (existingExpense.CreatedById != loggedInEmployee.Id)
|
||||||
{
|
{
|
||||||
_logger.LogWarning("User attempted to update expense with ID {ExpenseId} which not created by them", loggedInEmployee.Id);
|
_logger.LogWarning("User attempted to update expense with ID {ExpenseId} which not created by them", existingExpense.Id);
|
||||||
return ApiResponse<object>.ErrorResponse("You donot have access to update this expense", "You donot have access to update this expense", 400);
|
return ApiResponse<object>.ErrorResponse("You donot have access to update this expense", "You donot have access to update this expense", 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user