upvotes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing

This commit is contained in:
2024-04-23 19:13:48 +03:00
parent a1df10c37e
commit ed403c2c72
11 changed files with 147 additions and 17 deletions

View File

@@ -36,7 +36,7 @@ func (t *Feedback) GetByUUID(uuid string) (*models.Feedback, error) {
var ticket models.Feedback
res := t.db.
Preload("Upvote").
Preload("Vote").
Where("uuid = ?", uuid).
First(&ticket)
if res.Error != nil {
@@ -63,3 +63,10 @@ func (t *Feedback) GetByProjectID(projectID string) ([]*models.Feedback, error)
func (t *Feedback) CreateUpvote(upvote *models.Upvote) error {
return t.db.Create(upvote).Error
}
func (t *Feedback) DeleteUpvoteBySessionIDAndFeedbackUUID(sessionID, feedbackUUID string) error {
return t.db.
Where("session_uuid = ?", sessionID).
Where("feedback_uuid = ?", feedbackUUID).
Delete(&models.Upvote{}).Error
}