This commit is contained in:
parent
8e6f814ba4
commit
e317da1b66
6 changed files with 106 additions and 18 deletions
|
@ -113,8 +113,7 @@ func undoLike(w http.ResponseWriter, r *http.Request, object map[string]any, tar
|
|||
_ = webutils.ProblemDetailsStatusOnly(w, http.StatusInternalServerError)
|
||||
return false
|
||||
}
|
||||
reactionId := uint(other.Must(strconv.ParseUint(act.ObjectId, 10, 64)))
|
||||
reaction, err := dbgen.Reaction.Where(dbgen.Reaction.ID.Eq(reactionId)).First()
|
||||
reaction, err := dbgen.Reaction.Where(dbgen.Reaction.ID.Eq(act.ObjectId)).First()
|
||||
switch err {
|
||||
case gorm.ErrRecordNotFound:
|
||||
return true
|
||||
|
@ -140,7 +139,7 @@ func undoLike(w http.ResponseWriter, r *http.Request, object map[string]any, tar
|
|||
_ = tx.Rollback()
|
||||
log.Error().
|
||||
Err(err).
|
||||
Uint("reaction-id", reaction.ID).
|
||||
Str("reaction-id", reaction.ID).
|
||||
Msg("Failed to delete reaction on undo")
|
||||
_ = webutils.ProblemDetailsStatusOnly(w, http.StatusInternalServerError)
|
||||
return false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue