Enhance Feedback and Tender Approval Services with Toggle Functionality
- Updated the ToggleFeedback method in the feedback service to change the FeedbackType to "unlike" or "undislike" based on the current state, improving user interaction with feedback. - Modified the ToggleTenderApproval method in the tender approval service to update the Status to "unapproved" or "unrejected" depending on the current approval state, streamlining tender approval management. - These enhancements improve the overall functionality and user experience of the tender management system.
This commit is contained in:
@@ -65,6 +65,12 @@ func (s *feedbackService) ToggleFeedback(ctx context.Context, req ToggleFeedback
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.FeedbackType == FeedbackTypeLike {
|
||||||
|
existing.FeedbackType = "unlike"
|
||||||
|
} else {
|
||||||
|
existing.FeedbackType = "undislike"
|
||||||
|
}
|
||||||
|
|
||||||
return existing.ToResponse(), nil
|
return existing.ToResponse(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1008,6 +1008,12 @@ func (s *tenderApprovalService) ToggleTenderApproval(ctx context.Context, req *T
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.Status == ApprovalStatusApproved {
|
||||||
|
existing.Status = "unapproved"
|
||||||
|
} else {
|
||||||
|
existing.Status = "unrejected"
|
||||||
|
}
|
||||||
|
|
||||||
return existing.ToResponseWithTender(nil), nil
|
return existing.ToResponseWithTender(nil), nil
|
||||||
} else if existing.Status == req.Status && existing.SubmissionMode != req.SubmissionMode {
|
} else if existing.Status == req.Status && existing.SubmissionMode != req.SubmissionMode {
|
||||||
existing.SubmissionMode = req.SubmissionMode
|
existing.SubmissionMode = req.SubmissionMode
|
||||||
|
|||||||
Reference in New Issue
Block a user