fix comments create/update not applying character name.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-04-11 01:49:08 +02:00
parent b641f7d516
commit 87559997a9
3 changed files with 5 additions and 2 deletions
+3 -2
View File
@@ -53,7 +53,7 @@ func (r *commentRepository) Insert(ctx context.Context, comment models.Comment)
CharacterID: comment.CharacterID, CharacterID: comment.CharacterID,
Subject: comment.Subject, Subject: comment.Subject,
Author: comment.Author, Author: comment.Author,
CharacterName: comment.CharacterID, CharacterName: comment.CharacterName,
Source: comment.Source, Source: comment.Source,
CreatedDate: comment.CreatedDate.UTC(), CreatedDate: comment.CreatedDate.UTC(),
FictionalDate: comment.FictionalDate.UTC(), FictionalDate: comment.FictionalDate.UTC(),
@@ -73,7 +73,8 @@ func (r *commentRepository) Update(ctx context.Context, comment models.Comment,
Subject: comment.Subject, Subject: comment.Subject,
Source: comment.Source, Source: comment.Source,
FictionalDate: comment.FictionalDate.UTC(), FictionalDate: comment.FictionalDate.UTC(),
CharacterName: comment.ChapterID, EditedDate: comment.EditedDate.UTC(),
CharacterName: comment.CharacterName,
CharacterID: comment.CharacterID, CharacterID: comment.CharacterID,
ID: comment.ID, ID: comment.ID,
}) })
+1
View File
@@ -14,6 +14,7 @@ UPDATE story_comment
SET subject = @subject, SET subject = @subject,
source = @source, source = @source,
fictional_date = @fictional_date, fictional_date = @fictional_date,
edited_date = @edited_date,
character_name = @character_name, character_name = @character_name,
character_id = @character_id character_id = @character_id
WHERE id = @id; WHERE id = @id;
+1
View File
@@ -32,6 +32,7 @@ func (comment *Comment) ApplyUpdate(update CommentUpdate) {
if update.FictionalDate != nil { if update.FictionalDate != nil {
comment.FictionalDate = *update.FictionalDate comment.FictionalDate = *update.FictionalDate
} }
comment.EditedDate = time.Now()
} }
// IsChangeObject is an interface implementation to identify it as a valid // IsChangeObject is an interface implementation to identify it as a valid