Skip to content

Commit

Permalink
Merge pull request #115 from bmf-san/feature/changed-order
Browse files Browse the repository at this point in the history
Changed items order
  • Loading branch information
bmf-san authored May 4, 2024
2 parents d32bb8a + ea5b739 commit 0a290c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/interfaces/repository/category.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (cr *Category) FindAll(page int, limit int) (domain.Categories, error) {
*
FROM
categories
ORDER BY id
ORDER BY created_at
DESC
LIMIT ?, ?
`, page*limit-limit, limit)
Expand Down
2 changes: 1 addition & 1 deletion app/interfaces/repository/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (cr *Comment) FindAll(page int, limit int) (domain.Comments, error) {
*
FROM
comments
ORDER BY id
ORDER BY created_at
DESC
LIMIT ?, ?
`, page*limit-limit, limit)
Expand Down
10 changes: 5 additions & 5 deletions app/interfaces/repository/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (pr *Post) FindAllPublic(page int, limit int) (domain.Posts, error) {
view_posts
WHERE
status = "public"
ORDER BY id
ORDER BY created_at
DESC
LIMIT ?, ?
`, page*limit-limit, limit)
Expand Down Expand Up @@ -367,7 +367,7 @@ func (pr *Post) FindAllPublicByKeyword(page int, limit int, keyword string) (dom
AGAINST (? IN BOOLEAN MODE)
AND
status = "public"
ORDER BY id
ORDER BY created_at
DESC
LIMIT ?, ?
`, keyword, page*limit-limit, limit)
Expand Down Expand Up @@ -603,7 +603,7 @@ func (pr *Post) FindAllPublicByCategory(page int, limit int, name string) (domai
WHERE
status = "public"
AND category_name = ?
ORDER BY id
ORDER BY created_at
DESC
LIMIT ?, ?
`, name, page*limit-limit, limit)
Expand Down Expand Up @@ -850,7 +850,7 @@ func (pr *Post) FindAllPublicByTag(page int, limit int, name string) (domain.Pos
WHERE
tags.name = ?
)
ORDER BY id
ORDER BY created_at
DESC
LIMIT ?, ?
`, name, page*limit-limit, limit)
Expand Down Expand Up @@ -1092,7 +1092,7 @@ func (pr *Post) FindAll(page int, limit int) (domain.Posts, error) {
*
FROM
view_posts
ORDER BY id
ORDER BY created_at
DESC
LIMIT ?, ?
`, page*limit-limit, limit)
Expand Down
2 changes: 1 addition & 1 deletion app/interfaces/repository/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (tr *Tag) FindAll(page int, limit int) (domain.Tags, error) {
*
FROM
tags
ORDER BY id
ORDER BY created_at
DESC
LIMIT ?, ?
`, page*limit-limit, limit)
Expand Down

0 comments on commit 0a290c0

Please sign in to comment.