Skip to content

Commit

Permalink
Merge pull request #1478 from stakwork/fix/modify_next_bounty
Browse files Browse the repository at this point in the history
Fix/modify next bounty
  • Loading branch information
elraphty authored Jan 30, 2024
2 parents d54fb48 + 453bc55 commit d38bbd0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 56 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/prjob_build.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/prjob_eslint.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/prjob_prettier.yml

This file was deleted.

8 changes: 4 additions & 4 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,25 +643,25 @@ func (db database) GetBountyById(id string) ([]Bounty, error) {

func (db database) GetNextBountyById(id string) ([]Bounty, error) {
ms := []Bounty{}
err := db.db.Raw(`SELECT * FROM public.bounty WHERE id > '` + id + `' ORDER BY id ASC LIMIT 1`).Find(&ms).Error
err := db.db.Raw(`SELECT * FROM public.bounty WHERE id > '` + id + `' AND show = true ORDER BY id ASC LIMIT 1`).Find(&ms).Error
return ms, err
}

func (db database) GetPreviousBountyById(id string) ([]Bounty, error) {
ms := []Bounty{}
err := db.db.Raw(`SELECT * FROM public.bounty WHERE id < '` + id + `' ORDER BY id DESC LIMIT 1`).Find(&ms).Error
err := db.db.Raw(`SELECT * FROM public.bounty WHERE id < '` + id + `' AND show = true ORDER BY id DESC LIMIT 1`).Find(&ms).Error
return ms, err
}

func (db database) GetNextOrganizationBountyById(uuid string, id string) ([]Bounty, error) {
ms := []Bounty{}
err := db.db.Raw(`SELECT * FROM public.bounty WHERE org_uuid = '` + uuid + `' AND id > '` + id + `' ORDER BY id ASC LIMIT 1`).Find(&ms).Error
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
return ms, err
}

func (db database) GetPreviousOrganizationBountyById(uuid string, id string) ([]Bounty, error) {
ms := []Bounty{}
err := db.db.Raw(`SELECT * FROM public.bounty WHERE org_uuid = '` + uuid + `' AND id < '` + id + `' ORDER BY id DESC LIMIT 1`).Find(&ms).Error
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
return ms, err
}

Expand Down

0 comments on commit d38bbd0

Please sign in to comment.