posts, counter: Fixed post positions issues when a post is deleted.
the build was successful

This commit is contained in:
2018-12-02 21:27:50 +01:00
parent 31239330df
commit ac2b79e88a
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -1,6 +1,7 @@
package posts
import (
"git.aiterp.net/rpdata/api/internal/counter"
"git.aiterp.net/rpdata/api/models"
"github.com/globalsign/mgo/bson"
)
@@ -20,6 +21,8 @@ func Remove(post models.Post) (models.Post, error) {
return models.Post{}, err
}
counter.NextMany("next_post_id", post.LogID, -1)
return post, nil
}