Refactor ToggleTenderApproval Logic to Simplify Status Check
- Updated the ToggleTenderApproval method to remove the redundant check for SubmissionMode when determining if an existing tender approval should be deleted. - This change enhances the clarity of the approval logic and improves maintainability by focusing solely on the Status comparison.
This commit is contained in:
@@ -995,7 +995,7 @@ func (s *tenderApprovalService) ToggleTenderApproval(ctx context.Context, req *T
|
||||
return approval.ToResponseWithTender(nil), nil
|
||||
}
|
||||
|
||||
if existing.Status == req.Status && existing.SubmissionMode == req.SubmissionMode {
|
||||
if existing.Status == req.Status {
|
||||
err = s.repository.Delete(ctx, existing.GetID())
|
||||
if err != nil {
|
||||
s.logger.Error("Failed to update tender approval", map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user