Skip to content

Commit

Permalink
feat: show non archived urls on the home page.
Browse files Browse the repository at this point in the history
  • Loading branch information
puni9869 committed Nov 25, 2024
1 parent 197f369 commit aed3881
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/home/home.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package home

import (
"net/http"
"strconv"

"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
"github.com/puni9869/pinmyblogs/models"
Expand All @@ -9,8 +12,6 @@ import (
"github.com/puni9869/pinmyblogs/pkg/spider"
"github.com/puni9869/pinmyblogs/server/middlewares"
"github.com/puni9869/pinmyblogs/types/forms"

Check failure on line 14 in server/home/home.go

View workflow job for this annotation

GitHub Actions / checks

"github.com/puni9869/pinmyblogs/types/forms" imported and not used (typecheck)
"net/http"
"strconv"
)

func AddWeblink(c *gin.Context) {
Expand Down Expand Up @@ -45,7 +46,7 @@ func Home(c *gin.Context) {
currentlyLoggedIn := session.Get(middlewares.Userkey)
var urls []models.Url
db := database.Db()
result := db.Where("created_by =? and is_active = ? and is_deleted = ?", currentlyLoggedIn.(string), true, false).
result := db.Where("created_by =? and is_active = ? and is_deleted = ? and is_archived = ?", currentlyLoggedIn.(string), true, false, false).
Order("id desc").
Limit(100).
Find(&urls)
Expand Down

0 comments on commit aed3881

Please sign in to comment.