mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22: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)
|
c.HTML(http.StatusInternalServerError, "500.html", nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
count, err := Repositories.Posts.GetCount()
|
count, err := Repositories.Posts.GetThreadsCount()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("error:", err)
|
log.Println("error:", err)
|
||||||
c.HTML(http.StatusInternalServerError, "500.html", nil)
|
c.HTML(http.StatusInternalServerError, "500.html", nil)
|
||||||
@ -140,7 +140,7 @@ func CreateThread(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
defer conn.Release()
|
defer conn.Release()
|
||||||
|
|
||||||
threadsCount, err := Repositories.Posts.GetCount()
|
threadsCount, err := Repositories.Posts.GetThreadsCount()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("error:", err)
|
log.Println("error:", err)
|
||||||
c.HTML(http.StatusInternalServerError, "500.html", nil)
|
c.HTML(http.StatusInternalServerError, "500.html", nil)
|
||||||
|
@ -61,7 +61,7 @@ func (r *PostsRepository) Get(limit, offset int) ([]Post, error) {
|
|||||||
return posts, nil
|
return posts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PostsRepository) GetCount() (int, error) {
|
func (r *PostsRepository) GetThreadsCount() (int, error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
FROM posts
|
FROM posts
|
||||||
|
Loading…
Reference in New Issue
Block a user