Skip to content

Commit

Permalink
fix: code snippets order by date created
Browse files Browse the repository at this point in the history
  • Loading branch information
abinba committed Apr 19, 2024
1 parent 07974d0 commit 026fdd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handler/code_snippet_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func GetAllCodeSnippets(c *fiber.Ctx) error {
db := database.DB.Db

var code_snippets []model.CodeSnippet
db.Find(&code_snippets)
db.Find(&code_snippets).Order("created_at desc")

if len(code_snippets) == 0 {
return c.Status(404).JSON(fiber.Map{
Expand Down

0 comments on commit 026fdd1

Please sign in to comment.