Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-20 committed Dec 20, 2024
1 parent f441720 commit db22735
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions model/comments.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package model

import "errors"

type Comment struct {
GormModel
ItemID int `gorm:"type:int;not null" json:"item_id"`
Expand All @@ -20,15 +18,6 @@ type CreateCommentPayload struct {
}

func CreateComment(p *CreateCommentPayload) (*Comment, error) {
if p.ItemID == 0 {
return nil, errors.New("ItemID is required")
}
if p.UserID == "" {
return nil, errors.New("UserID is required")
}
if p.Comment == "" {
return nil, errors.New("Comment is required")
}
c := Comment{
ItemID: p.ItemID,
UserID: p.UserID,
Expand Down

0 comments on commit db22735

Please sign in to comment.