diff --git a/db/db.go b/db/db.go index 7f938e2c1..cd2478953 100644 --- a/db/db.go +++ b/db/db.go @@ -712,27 +712,249 @@ func (db database) GetBountyById(id string) ([]Bounty, error) { return ms, err } -func (db database) GetNextBountyById(id string) ([]Bounty, error) { +func (db database) GetNextBountyById(r *http.Request) ([]Bounty, error) { + id := chi.URLParam(r, "bountyId") + keys := r.URL.Query() + _, _, _, _, search := utils.GetPaginationParams(r) ms := []Bounty{} - err := db.db.Raw(`SELECT * FROM public.bounty WHERE id > '` + id + `' AND show = true ORDER BY id ASC LIMIT 1`).Find(&ms).Error + + open := keys.Get("Open") + assingned := keys.Get("Assigned") + paid := keys.Get("Paid") + languages := keys.Get("languages") + languageArray := strings.Split(languages, ",") + languageLength := len(languageArray) + + var languageQuery string + var statusQuery string + var searchQuery string + var statusConditions []string + + if search != "" { + searchQuery = fmt.Sprintf("AND LOWER(title) LIKE %s", "'%"+strings.ToLower(search)+"%'") + } + + if open == "true" { + statusConditions = append(statusConditions, "assignee = '' AND paid != true") + } + if assingned == "true" { + statusConditions = append(statusConditions, "assignee != '' AND paid = false") + } + if paid == "true" { + statusConditions = append(statusConditions, "paid = true") + } + + if len(statusConditions) > 0 { + statusQuery = " AND (" + strings.Join(statusConditions, " OR ") + ")" + } else { + statusQuery = "" + } + + if languageLength > 0 { + langs := "" + for i, val := range languageArray { + if val != "" { + if i == 0 { + langs = "'" + val + "'" + } else { + langs = langs + ", '" + val + "'" + } + languageQuery = "AND coding_languages && ARRAY[" + langs + "]" + } + } + } + + query := `SELECT * FROM public.bounty WHERE id > '` + id + `' AND show = true` + orderQuery := "ORDER BY id ASC LIMIT 1" + + allQuery := query + " " + searchQuery + " " + statusQuery + " " + languageQuery + " " + orderQuery + + err := db.db.Raw(allQuery).Find(&ms).Error return ms, err } -func (db database) GetPreviousBountyById(id string) ([]Bounty, error) { +func (db database) GetPreviousBountyById(r *http.Request) ([]Bounty, error) { + id := chi.URLParam(r, "bountyId") + keys := r.URL.Query() + _, _, _, _, search := utils.GetPaginationParams(r) ms := []Bounty{} - err := db.db.Raw(`SELECT * FROM public.bounty WHERE id < '` + id + `' AND show = true ORDER BY id DESC LIMIT 1`).Find(&ms).Error + + open := keys.Get("Open") + assingned := keys.Get("Assigned") + paid := keys.Get("Paid") + languages := keys.Get("languages") + languageArray := strings.Split(languages, ",") + languageLength := len(languageArray) + + var languageQuery string + var statusQuery string + var searchQuery string + var statusConditions []string + + if search != "" { + searchQuery = fmt.Sprintf("AND LOWER(title) LIKE %s", "'%"+strings.ToLower(search)+"%'") + } + + if open == "true" { + statusConditions = append(statusConditions, "assignee = '' AND paid != true") + } + if assingned == "true" { + statusConditions = append(statusConditions, "assignee != '' AND paid = false") + } + if paid == "true" { + statusConditions = append(statusConditions, "paid = true") + } + + if len(statusConditions) > 0 { + statusQuery = " AND (" + strings.Join(statusConditions, " OR ") + ")" + } else { + statusQuery = "" + } + + if languageLength > 0 { + langs := "" + for i, val := range languageArray { + if val != "" { + if i == 0 { + langs = "'" + val + "'" + } else { + langs = langs + ", '" + val + "'" + } + languageQuery = "AND coding_languages && ARRAY[" + langs + "]" + } + } + } + + query := `SELECT * FROM public.bounty WHERE id < '` + id + `' AND show = true` + orderQuery := "ORDER BY id DESC LIMIT 1" + + allQuery := query + " " + searchQuery + " " + statusQuery + " " + languageQuery + " " + orderQuery + + err := db.db.Raw(allQuery).Find(&ms).Error return ms, err } -func (db database) GetNextOrganizationBountyById(uuid string, id string) ([]Bounty, error) { +func (db database) GetNextOrganizationBountyById(r *http.Request) ([]Bounty, error) { + id := chi.URLParam(r, "bountyId") + uuid := chi.URLParam(r, "uuid") + keys := r.URL.Query() + _, _, _, _, search := utils.GetPaginationParams(r) ms := []Bounty{} - err := db.db.Raw(`SELECT * FROM public.bounty WHERE org_uuid = '` + uuid + `' AND id > '` + id + `' AND show = true ORDER BY id ASC LIMIT 1`).Find(&ms).Error + + open := keys.Get("Open") + assingned := keys.Get("Assigned") + paid := keys.Get("Paid") + languages := keys.Get("languages") + languageArray := strings.Split(languages, ",") + languageLength := len(languageArray) + + var languageQuery string + var statusQuery string + var searchQuery string + var statusConditions []string + + if search != "" { + searchQuery = fmt.Sprintf("AND LOWER(title) LIKE %s", "'%"+strings.ToLower(search)+"%'") + } + + if open == "true" { + statusConditions = append(statusConditions, "assignee = '' AND paid != true") + } + if assingned == "true" { + statusConditions = append(statusConditions, "assignee != '' AND paid = false") + } + if paid == "true" { + statusConditions = append(statusConditions, "paid = true") + } + + if len(statusConditions) > 0 { + statusQuery = " AND (" + strings.Join(statusConditions, " OR ") + ")" + } else { + statusQuery = "" + } + + if languageLength > 0 { + langs := "" + for i, val := range languageArray { + if val != "" { + if i == 0 { + langs = "'" + val + "'" + } else { + langs = langs + ", '" + val + "'" + } + languageQuery = "AND coding_languages && ARRAY[" + langs + "]" + } + } + } + + query := `SELECT * FROM public.bounty WHERE org_uuid = '` + uuid + `' AND id > '` + id + `' AND show = true` + orderQuery := "ORDER BY id ASC LIMIT 1" + + allQuery := query + " " + searchQuery + " " + statusQuery + " " + languageQuery + " " + orderQuery + + err := db.db.Raw(allQuery).Find(&ms).Error return ms, err } -func (db database) GetPreviousOrganizationBountyById(uuid string, id string) ([]Bounty, error) { +func (db database) GetPreviousOrganizationBountyById(r *http.Request) ([]Bounty, error) { + id := chi.URLParam(r, "bountyId") + uuid := chi.URLParam(r, "uuid") + keys := r.URL.Query() + _, _, _, _, search := utils.GetPaginationParams(r) ms := []Bounty{} - err := db.db.Raw(`SELECT * FROM public.bounty WHERE org_uuid = '` + uuid + `' AND id < '` + id + `' AND show = true ORDER BY id DESC LIMIT 1`).Find(&ms).Error + + open := keys.Get("Open") + assingned := keys.Get("Assigned") + paid := keys.Get("Paid") + languages := keys.Get("languages") + languageArray := strings.Split(languages, ",") + languageLength := len(languageArray) + + var languageQuery string + var statusQuery string + var searchQuery string + var statusConditions []string + + if search != "" { + searchQuery = fmt.Sprintf("AND LOWER(title) LIKE %s", "'%"+strings.ToLower(search)+"%'") + } + + if open == "true" { + statusConditions = append(statusConditions, "assignee = '' AND paid != true") + } + if assingned == "true" { + statusConditions = append(statusConditions, "assignee != '' AND paid = false") + } + if paid == "true" { + statusConditions = append(statusConditions, "paid = true") + } + + if len(statusConditions) > 0 { + statusQuery = " AND (" + strings.Join(statusConditions, " OR ") + ")" + } else { + statusQuery = "" + } + + if languageLength > 0 { + langs := "" + for i, val := range languageArray { + if val != "" { + if i == 0 { + langs = "'" + val + "'" + } else { + langs = langs + ", '" + val + "'" + } + languageQuery = "AND coding_languages && ARRAY[" + langs + "]" + } + } + } + + query := `SELECT * FROM public.bounty WHERE org_uuid = '` + uuid + `' AND id < '` + id + `' AND show = true` + orderQuery := "ORDER BY id DESC LIMIT 1" + + allQuery := query + " " + searchQuery + " " + statusQuery + " " + languageQuery + " " + orderQuery + + err := db.db.Raw(allQuery).Find(&ms).Error return ms, err } @@ -785,7 +1007,7 @@ func (db database) GetAllBounties(r *http.Request) []Bounty { limitQuery = fmt.Sprintf("LIMIT %d OFFSET %d", limit, offset) } if search != "" { - searchQuery = fmt.Sprintf("AND LOWER(title) LIKE %s", "'%"+search+"%'") + searchQuery = fmt.Sprintf("AND LOWER(title) LIKE %s", "'%"+strings.ToLower(search)+"%'") } if open != "" && open == "true" { openQuery = "AND assignee = '' AND paid != true" diff --git a/db/interface.go b/db/interface.go index 1491dd880..f6b0c09df 100644 --- a/db/interface.go +++ b/db/interface.go @@ -35,10 +35,10 @@ type Database interface { GetAssignedBounties(r *http.Request) ([]Bounty, error) GetCreatedBounties(r *http.Request) ([]Bounty, error) GetBountyById(id string) ([]Bounty, error) - GetNextBountyById(id string) ([]Bounty, error) - GetPreviousBountyById(id string) ([]Bounty, error) - GetNextOrganizationBountyById(uuid string, id string) ([]Bounty, error) - GetPreviousOrganizationBountyById(uuid string, id string) ([]Bounty, error) + GetNextBountyById(r *http.Request) ([]Bounty, error) + GetPreviousBountyById(r *http.Request) ([]Bounty, error) + GetNextOrganizationBountyById(r *http.Request) ([]Bounty, error) + GetPreviousOrganizationBountyById(r *http.Request) ([]Bounty, error) GetBountyIndexById(id string) int64 GetBountyDataByCreated(created string) ([]Bounty, error) AddBounty(b Bounty) (Bounty, error) diff --git a/handlers/bounty.go b/handlers/bounty.go index 4dcf2e344..eceeff414 100644 --- a/handlers/bounty.go +++ b/handlers/bounty.go @@ -55,11 +55,7 @@ func GetBountyById(w http.ResponseWriter, r *http.Request) { } func GetNextBountyById(w http.ResponseWriter, r *http.Request) { - bountyId := chi.URLParam(r, "bountyId") - if bountyId == "" { - w.WriteHeader(http.StatusNotFound) - } - bounties, err := db.DB.GetNextBountyById(bountyId) + bounties, err := db.DB.GetNextBountyById(r) if err != nil { w.WriteHeader(http.StatusBadRequest) fmt.Println("Error", err) @@ -71,11 +67,7 @@ func GetNextBountyById(w http.ResponseWriter, r *http.Request) { } func GetPreviousBountyById(w http.ResponseWriter, r *http.Request) { - bountyId := chi.URLParam(r, "bountyId") - if bountyId == "" { - w.WriteHeader(http.StatusNotFound) - } - bounties, err := db.DB.GetPreviousBountyById(bountyId) + bounties, err := db.DB.GetPreviousBountyById(r) if err != nil { w.WriteHeader(http.StatusBadRequest) fmt.Println("Error", err) @@ -87,12 +79,7 @@ func GetPreviousBountyById(w http.ResponseWriter, r *http.Request) { } func GetOrganizationNextBountyById(w http.ResponseWriter, r *http.Request) { - bountyId := chi.URLParam(r, "bountyId") - uuid := chi.URLParam(r, "uuid") - if bountyId == "" || uuid == "" { - w.WriteHeader(http.StatusNotFound) - } - bounties, err := db.DB.GetNextOrganizationBountyById(uuid, bountyId) + bounties, err := db.DB.GetNextOrganizationBountyById(r) if err != nil { w.WriteHeader(http.StatusBadRequest) fmt.Println("Error", err) @@ -104,12 +91,7 @@ func GetOrganizationNextBountyById(w http.ResponseWriter, r *http.Request) { } func GetOrganizationPreviousBountyById(w http.ResponseWriter, r *http.Request) { - bountyId := chi.URLParam(r, "bountyId") - uuid := chi.URLParam(r, "uuid") - if bountyId == "" || uuid == "" { - w.WriteHeader(http.StatusNotFound) - } - bounties, err := db.DB.GetPreviousOrganizationBountyById(uuid, bountyId) + bounties, err := db.DB.GetPreviousOrganizationBountyById(r) if err != nil { w.WriteHeader(http.StatusBadRequest) fmt.Println("Error", err) diff --git a/mocks/Database.go b/mocks/Database.go index a27ea51cb..14154ec1d 100644 --- a/mocks/Database.go +++ b/mocks/Database.go @@ -3007,9 +3007,9 @@ func (_c *Database_GetLnUser_Call) RunAndReturn(run func(string) int64) *Databas return _c } -// GetNextBountyById provides a mock function with given fields: id -func (_m *Database) GetNextBountyById(id string) ([]db.Bounty, error) { - ret := _m.Called(id) +// GetNextBountyById provides a mock function with given fields: r +func (_m *Database) GetNextBountyById(r *http.Request) ([]db.Bounty, error) { + ret := _m.Called(r) if len(ret) == 0 { panic("no return value specified for GetNextBountyById") @@ -3017,19 +3017,19 @@ func (_m *Database) GetNextBountyById(id string) ([]db.Bounty, error) { var r0 []db.Bounty var r1 error - if rf, ok := ret.Get(0).(func(string) ([]db.Bounty, error)); ok { - return rf(id) + if rf, ok := ret.Get(0).(func(*http.Request) ([]db.Bounty, error)); ok { + return rf(r) } - if rf, ok := ret.Get(0).(func(string) []db.Bounty); ok { - r0 = rf(id) + if rf, ok := ret.Get(0).(func(*http.Request) []db.Bounty); ok { + r0 = rf(r) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]db.Bounty) } } - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(id) + if rf, ok := ret.Get(1).(func(*http.Request) error); ok { + r1 = rf(r) } else { r1 = ret.Error(1) } @@ -3043,14 +3043,14 @@ type Database_GetNextBountyById_Call struct { } // GetNextBountyById is a helper method to define mock.On call -// - id string -func (_e *Database_Expecter) GetNextBountyById(id interface{}) *Database_GetNextBountyById_Call { - return &Database_GetNextBountyById_Call{Call: _e.mock.On("GetNextBountyById", id)} +// - r *http.Request +func (_e *Database_Expecter) GetNextBountyById(r interface{}) *Database_GetNextBountyById_Call { + return &Database_GetNextBountyById_Call{Call: _e.mock.On("GetNextBountyById", r)} } -func (_c *Database_GetNextBountyById_Call) Run(run func(id string)) *Database_GetNextBountyById_Call { +func (_c *Database_GetNextBountyById_Call) Run(run func(r *http.Request)) *Database_GetNextBountyById_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + run(args[0].(*http.Request)) }) return _c } @@ -3060,14 +3060,14 @@ func (_c *Database_GetNextBountyById_Call) Return(_a0 []db.Bounty, _a1 error) *D return _c } -func (_c *Database_GetNextBountyById_Call) RunAndReturn(run func(string) ([]db.Bounty, error)) *Database_GetNextBountyById_Call { +func (_c *Database_GetNextBountyById_Call) RunAndReturn(run func(*http.Request) ([]db.Bounty, error)) *Database_GetNextBountyById_Call { _c.Call.Return(run) return _c } -// GetNextOrganizationBountyById provides a mock function with given fields: uuid, id -func (_m *Database) GetNextOrganizationBountyById(uuid string, id string) ([]db.Bounty, error) { - ret := _m.Called(uuid, id) +// GetNextOrganizationBountyById provides a mock function with given fields: r +func (_m *Database) GetNextOrganizationBountyById(r *http.Request) ([]db.Bounty, error) { + ret := _m.Called(r) if len(ret) == 0 { panic("no return value specified for GetNextOrganizationBountyById") @@ -3075,19 +3075,19 @@ func (_m *Database) GetNextOrganizationBountyById(uuid string, id string) ([]db. var r0 []db.Bounty var r1 error - if rf, ok := ret.Get(0).(func(string, string) ([]db.Bounty, error)); ok { - return rf(uuid, id) + if rf, ok := ret.Get(0).(func(*http.Request) ([]db.Bounty, error)); ok { + return rf(r) } - if rf, ok := ret.Get(0).(func(string, string) []db.Bounty); ok { - r0 = rf(uuid, id) + if rf, ok := ret.Get(0).(func(*http.Request) []db.Bounty); ok { + r0 = rf(r) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]db.Bounty) } } - if rf, ok := ret.Get(1).(func(string, string) error); ok { - r1 = rf(uuid, id) + if rf, ok := ret.Get(1).(func(*http.Request) error); ok { + r1 = rf(r) } else { r1 = ret.Error(1) } @@ -3101,15 +3101,14 @@ type Database_GetNextOrganizationBountyById_Call struct { } // GetNextOrganizationBountyById is a helper method to define mock.On call -// - uuid string -// - id string -func (_e *Database_Expecter) GetNextOrganizationBountyById(uuid interface{}, id interface{}) *Database_GetNextOrganizationBountyById_Call { - return &Database_GetNextOrganizationBountyById_Call{Call: _e.mock.On("GetNextOrganizationBountyById", uuid, id)} +// - r *http.Request +func (_e *Database_Expecter) GetNextOrganizationBountyById(r interface{}) *Database_GetNextOrganizationBountyById_Call { + return &Database_GetNextOrganizationBountyById_Call{Call: _e.mock.On("GetNextOrganizationBountyById", r)} } -func (_c *Database_GetNextOrganizationBountyById_Call) Run(run func(uuid string, id string)) *Database_GetNextOrganizationBountyById_Call { +func (_c *Database_GetNextOrganizationBountyById_Call) Run(run func(r *http.Request)) *Database_GetNextOrganizationBountyById_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) + run(args[0].(*http.Request)) }) return _c } @@ -3119,7 +3118,7 @@ func (_c *Database_GetNextOrganizationBountyById_Call) Return(_a0 []db.Bounty, _ return _c } -func (_c *Database_GetNextOrganizationBountyById_Call) RunAndReturn(run func(string, string) ([]db.Bounty, error)) *Database_GetNextOrganizationBountyById_Call { +func (_c *Database_GetNextOrganizationBountyById_Call) RunAndReturn(run func(*http.Request) ([]db.Bounty, error)) *Database_GetNextOrganizationBountyById_Call { _c.Call.Return(run) return _c } @@ -4221,9 +4220,9 @@ func (_c *Database_GetPersonByUuid_Call) RunAndReturn(run func(string) db.Person return _c } -// GetPreviousBountyById provides a mock function with given fields: id -func (_m *Database) GetPreviousBountyById(id string) ([]db.Bounty, error) { - ret := _m.Called(id) +// GetPreviousBountyById provides a mock function with given fields: r +func (_m *Database) GetPreviousBountyById(r *http.Request) ([]db.Bounty, error) { + ret := _m.Called(r) if len(ret) == 0 { panic("no return value specified for GetPreviousBountyById") @@ -4231,19 +4230,19 @@ func (_m *Database) GetPreviousBountyById(id string) ([]db.Bounty, error) { var r0 []db.Bounty var r1 error - if rf, ok := ret.Get(0).(func(string) ([]db.Bounty, error)); ok { - return rf(id) + if rf, ok := ret.Get(0).(func(*http.Request) ([]db.Bounty, error)); ok { + return rf(r) } - if rf, ok := ret.Get(0).(func(string) []db.Bounty); ok { - r0 = rf(id) + if rf, ok := ret.Get(0).(func(*http.Request) []db.Bounty); ok { + r0 = rf(r) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]db.Bounty) } } - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(id) + if rf, ok := ret.Get(1).(func(*http.Request) error); ok { + r1 = rf(r) } else { r1 = ret.Error(1) } @@ -4257,14 +4256,14 @@ type Database_GetPreviousBountyById_Call struct { } // GetPreviousBountyById is a helper method to define mock.On call -// - id string -func (_e *Database_Expecter) GetPreviousBountyById(id interface{}) *Database_GetPreviousBountyById_Call { - return &Database_GetPreviousBountyById_Call{Call: _e.mock.On("GetPreviousBountyById", id)} +// - r *http.Request +func (_e *Database_Expecter) GetPreviousBountyById(r interface{}) *Database_GetPreviousBountyById_Call { + return &Database_GetPreviousBountyById_Call{Call: _e.mock.On("GetPreviousBountyById", r)} } -func (_c *Database_GetPreviousBountyById_Call) Run(run func(id string)) *Database_GetPreviousBountyById_Call { +func (_c *Database_GetPreviousBountyById_Call) Run(run func(r *http.Request)) *Database_GetPreviousBountyById_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) + run(args[0].(*http.Request)) }) return _c } @@ -4274,14 +4273,14 @@ func (_c *Database_GetPreviousBountyById_Call) Return(_a0 []db.Bounty, _a1 error return _c } -func (_c *Database_GetPreviousBountyById_Call) RunAndReturn(run func(string) ([]db.Bounty, error)) *Database_GetPreviousBountyById_Call { +func (_c *Database_GetPreviousBountyById_Call) RunAndReturn(run func(*http.Request) ([]db.Bounty, error)) *Database_GetPreviousBountyById_Call { _c.Call.Return(run) return _c } -// GetPreviousOrganizationBountyById provides a mock function with given fields: uuid, id -func (_m *Database) GetPreviousOrganizationBountyById(uuid string, id string) ([]db.Bounty, error) { - ret := _m.Called(uuid, id) +// GetPreviousOrganizationBountyById provides a mock function with given fields: r +func (_m *Database) GetPreviousOrganizationBountyById(r *http.Request) ([]db.Bounty, error) { + ret := _m.Called(r) if len(ret) == 0 { panic("no return value specified for GetPreviousOrganizationBountyById") @@ -4289,19 +4288,19 @@ func (_m *Database) GetPreviousOrganizationBountyById(uuid string, id string) ([ var r0 []db.Bounty var r1 error - if rf, ok := ret.Get(0).(func(string, string) ([]db.Bounty, error)); ok { - return rf(uuid, id) + if rf, ok := ret.Get(0).(func(*http.Request) ([]db.Bounty, error)); ok { + return rf(r) } - if rf, ok := ret.Get(0).(func(string, string) []db.Bounty); ok { - r0 = rf(uuid, id) + if rf, ok := ret.Get(0).(func(*http.Request) []db.Bounty); ok { + r0 = rf(r) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]db.Bounty) } } - if rf, ok := ret.Get(1).(func(string, string) error); ok { - r1 = rf(uuid, id) + if rf, ok := ret.Get(1).(func(*http.Request) error); ok { + r1 = rf(r) } else { r1 = ret.Error(1) } @@ -4315,15 +4314,14 @@ type Database_GetPreviousOrganizationBountyById_Call struct { } // GetPreviousOrganizationBountyById is a helper method to define mock.On call -// - uuid string -// - id string -func (_e *Database_Expecter) GetPreviousOrganizationBountyById(uuid interface{}, id interface{}) *Database_GetPreviousOrganizationBountyById_Call { - return &Database_GetPreviousOrganizationBountyById_Call{Call: _e.mock.On("GetPreviousOrganizationBountyById", uuid, id)} +// - r *http.Request +func (_e *Database_Expecter) GetPreviousOrganizationBountyById(r interface{}) *Database_GetPreviousOrganizationBountyById_Call { + return &Database_GetPreviousOrganizationBountyById_Call{Call: _e.mock.On("GetPreviousOrganizationBountyById", r)} } -func (_c *Database_GetPreviousOrganizationBountyById_Call) Run(run func(uuid string, id string)) *Database_GetPreviousOrganizationBountyById_Call { +func (_c *Database_GetPreviousOrganizationBountyById_Call) Run(run func(r *http.Request)) *Database_GetPreviousOrganizationBountyById_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) + run(args[0].(*http.Request)) }) return _c } @@ -4333,7 +4331,7 @@ func (_c *Database_GetPreviousOrganizationBountyById_Call) Return(_a0 []db.Bount return _c } -func (_c *Database_GetPreviousOrganizationBountyById_Call) RunAndReturn(run func(string, string) ([]db.Bounty, error)) *Database_GetPreviousOrganizationBountyById_Call { +func (_c *Database_GetPreviousOrganizationBountyById_Call) RunAndReturn(run func(*http.Request) ([]db.Bounty, error)) *Database_GetPreviousOrganizationBountyById_Call { _c.Call.Return(run) return _c }