File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -737,13 +737,18 @@ func GetIdeasByTrack(c echo.Context) error {
737737 TrackParam := c .QueryParam ("track" )
738738 TitleParam := c .QueryParam ("title" )
739739
740+ if TrackParam == " " || TitleParam == "" {
741+ TrackParam = "7"
742+ }
743+
740744 TrackParamInt , err := strconv .Atoi (TrackParam )
741745 if err != nil {
742746 return c .JSON (http .StatusBadRequest , & models.Response {
743747 Status : "fail" ,
744748 Message : err .Error (),
745749 })
746750 }
751+
747752 if TrackParamInt < 1 || TrackParamInt > 6 {
748753 TrackParamInt = 7
749754 }
@@ -755,6 +760,7 @@ func GetIdeasByTrack(c echo.Context) error {
755760 Track : TrackParamInt ,
756761 Title : TitleParam ,
757762 }
763+
758764 limitParam := c .QueryParam ("limit" )
759765 cursor := c .QueryParam ("cursor" )
760766
@@ -774,6 +780,7 @@ func GetIdeasByTrack(c echo.Context) error {
774780 }
775781
776782 var cursorUUID uuid.UUID
783+
777784 if cursor == "" {
778785 cursorUUID = uuid .Nil
779786 } else {
@@ -883,7 +890,7 @@ func GetIdeasByTrack(c echo.Context) error {
883890 })
884891 }
885892 case 7 :
886- trackname := tracks [7 ]
893+ trackname := tracks [6 ]
887894 idea , err = utils .Queries .GetIdeasByTrack (ctx , db.GetIdeasByTrackParams {
888895 Column1 : & payload .Title ,
889896 Column2 : & trackname ,
You can’t perform that action at this time.
0 commit comments