mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 06:12:33 +03:00
Fix - Rename method (#13)
This commit is contained in:
parent
edb39360d2
commit
4f23b5dc71
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user