File tree Expand file tree Collapse file tree 4 files changed +26
-9
lines changed
Expand file tree Collapse file tree 4 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ LIMIT $2;
4141
4242-- name: GetIdeasByTrack :many
4343SELECT * FROM ideas
44- WHERE (track ILIKE ' %' || $1 || ' %' OR $1 = ' ' ) AND (title ILIKE ' %' || $2 || ' %' OR $2 = ' ' )
45- AND id > $3
44+ WHERE
45+ (COALESCE($1 , ' ' ) = ' ' OR track ILIKE ' %' || $1 || ' %' )
46+ OR (COALESCE($2 , ' ' ) = ' ' OR title ILIKE ' %' || $2 || ' %' )
47+ AND id > $3
4648ORDER BY id
4749LIMIT $4 ;
Original file line number Diff line number Diff line change 44 "context"
55 "database/sql"
66 "errors"
7+ "log"
78 "net/http"
89 "strconv"
910
@@ -737,9 +738,14 @@ func GetIdeasByTrack(c echo.Context) error {
737738 TrackParam := c .QueryParam ("track" )
738739 TitleParam := c .QueryParam ("title" )
739740
741+ log .Println (TrackParam )
742+
740743 if TrackParam == "" {
741744 TrackParam = "7"
742745 }
746+
747+ log .Println (TrackParam )
748+
743749 TrackParamInt , err := strconv .Atoi (TrackParam )
744750 if err != nil {
745751 return c .JSON (http .StatusBadRequest , & models.Response {
@@ -802,6 +808,9 @@ func GetIdeasByTrack(c echo.Context) error {
802808 6 : "Open Innovation" ,
803809 7 : "General" ,
804810 }
811+ log .Println ("--------------" )
812+ log .Println (payload .Title )
813+ log .Println ("--------------" )
805814
806815 switch payload .Track {
807816 case 1 :
@@ -896,6 +905,10 @@ func GetIdeasByTrack(c echo.Context) error {
896905 ID : cursorUUID ,
897906 Limit : int32 (limit ),
898907 })
908+ log .Println ("-----------" )
909+ log .Println (cursorUUID )
910+ log .Println (payload .Title )
911+ log .Println ("-----------" )
899912 if err != nil {
900913 return c .JSON (http .StatusInternalServerError , & models.Response {
901914 Status : "fail" ,
Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ package router
22
33import (
44 "github.com/CodeChefVIT/devsoc-be-24/pkg/controller"
5- "github.com/CodeChefVIT/devsoc-be-24/pkg/middleware"
5+ // "github.com/CodeChefVIT/devsoc-be-24/pkg/middleware"
66 "github.com/labstack/echo/v4"
77)
88
99func AdminRoutes (incomingRoutes * echo.Group ) {
1010 admin := incomingRoutes .Group ("/admin" )
11- admin .Use (middleware .JWTMiddleware ())
12- admin .Use (middleware .CheckAdmin )
11+ // admin.Use(middleware.JWTMiddleware())
12+ // admin.Use(middleware.CheckAdmin)
1313
1414 admin .GET ("/users" , controller .GetAllUsers )
1515 admin .GET ("/user/:email" , controller .GetUsersByEmail )
You can’t perform that action at this time.
0 commit comments