rename method

This commit is contained in:
Yanislav Igonin 2022-03-10 14:18:04 +02:00
parent edb39360d2
commit 2baa5a2232
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ func GetThreads(c *gin.Context) {
c.HTML(http.StatusInternalServerError, "500.html", nil)
return
}
count, err := Repositories.Posts.GetCount()
count, err := Repositories.Posts.GetThreadsCount()
if err != nil {
log.Println("error:", err)
c.HTML(http.StatusInternalServerError, "500.html", nil)
@ -140,7 +140,7 @@ func CreateThread(c *gin.Context) {
}
defer conn.Release()
threadsCount, err := Repositories.Posts.GetCount()
threadsCount, err := Repositories.Posts.GetThreadsCount()
if err != nil {
log.Println("error:", err)
c.HTML(http.StatusInternalServerError, "500.html", nil)

View File

@ -61,7 +61,7 @@ func (r *PostsRepository) Get(limit, offset int) ([]Post, error) {
return posts, nil
}
func (r *PostsRepository) GetCount() (int, error) {
func (r *PostsRepository) GetThreadsCount() (int, error) {
sql := `
SELECT COUNT(*)
FROM posts