More work on file storage
Some checks failed
/ docker (push) Failing after 1m48s

This commit is contained in:
Melody Becker 2025-06-16 17:01:15 +02:00
parent 8e6f814ba4
commit e317da1b66
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
6 changed files with 106 additions and 18 deletions

View file

@ -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