@@ -258,11 +258,6 @@ func (r *postRepository) Delete(ctx context.Context, post models.Post) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = q.DeletePost(ctx, post.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = q.ShiftPostsAfter(ctx, psqlcore.ShiftPostsAfterParams{
|
||||
ShiftOffset: -1,
|
||||
LogShortID: post.LogID,
|
||||
@@ -272,6 +267,11 @@ func (r *postRepository) Delete(ctx context.Context, post models.Post) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = q.DeletePost(ctx, post.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Commit()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user