fix comments create/update not applying character name.
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -53,7 +53,7 @@ func (r *commentRepository) Insert(ctx context.Context, comment models.Comment)
|
||||
CharacterID: comment.CharacterID,
|
||||
Subject: comment.Subject,
|
||||
Author: comment.Author,
|
||||
CharacterName: comment.CharacterID,
|
||||
CharacterName: comment.CharacterName,
|
||||
Source: comment.Source,
|
||||
CreatedDate: comment.CreatedDate.UTC(),
|
||||
FictionalDate: comment.FictionalDate.UTC(),
|
||||
@@ -73,7 +73,8 @@ func (r *commentRepository) Update(ctx context.Context, comment models.Comment,
|
||||
Subject: comment.Subject,
|
||||
Source: comment.Source,
|
||||
FictionalDate: comment.FictionalDate.UTC(),
|
||||
CharacterName: comment.ChapterID,
|
||||
EditedDate: comment.EditedDate.UTC(),
|
||||
CharacterName: comment.CharacterName,
|
||||
CharacterID: comment.CharacterID,
|
||||
ID: comment.ID,
|
||||
})
|
||||
|
||||
@@ -14,6 +14,7 @@ UPDATE story_comment
|
||||
SET subject = @subject,
|
||||
source = @source,
|
||||
fictional_date = @fictional_date,
|
||||
edited_date = @edited_date,
|
||||
character_name = @character_name,
|
||||
character_id = @character_id
|
||||
WHERE id = @id;
|
||||
|
||||
@@ -32,6 +32,7 @@ func (comment *Comment) ApplyUpdate(update CommentUpdate) {
|
||||
if update.FictionalDate != nil {
|
||||
comment.FictionalDate = *update.FictionalDate
|
||||
}
|
||||
comment.EditedDate = time.Now()
|
||||
}
|
||||
|
||||
// IsChangeObject is an interface implementation to identify it as a valid
|
||||
|
||||
Reference in New Issue
Block a user