try fix again again.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-07-26 20:56:46 +02:00
parent bd27b14a88
commit 6b1f34db79
2 changed files with 11 additions and 10 deletions
+5 -4
View File
@@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"errors"
"fmt"
"git.aiterp.net/rpdata/api/database/postgres/psqlcore"
"git.aiterp.net/rpdata/api/internal/generate"
"git.aiterp.net/rpdata/api/models"
@@ -255,7 +256,7 @@ func (r *postRepository) Delete(ctx context.Context, post models.Post) error {
err = q.MovePost(ctx, psqlcore.MovePostParams{ID: post.ID, Position: -1})
if err != nil {
return err
return fmt.Errorf("pre-delete move failed: %s", err)
}
err = q.ShiftPostsAfter(ctx, psqlcore.ShiftPostsAfterParams{
@@ -264,17 +265,17 @@ func (r *postRepository) Delete(ctx context.Context, post models.Post) error {
FromPosition: int32(post.Position + 1),
})
if err != nil {
return err
return fmt.Errorf("shift failed: %s", err)
}
err = q.DeletePost(ctx, post.ID)
if err != nil {
return err
return fmt.Errorf("delete failed: %s", err)
}
err = tx.Commit()
if err != nil {
return err
return fmt.Errorf("tx commit failed: %s", err)
}
_ = psqlcore.New(r.db).GenerateLogTSVector(ctx, post.LogID)