stakwork / sphinx-tribes

Backend for sphinx tribes and bounties. The bounty platform pays out in bitcoin. Sign up with Sphinx Chat, complete a bounty, and earn bitcoin! Go to our website for available bounties.
https://community.sphinx.chat/bounties
33 stars 60 forks source link

Add Pagination, Sorting and 3 summary fields to endpoint Get Features for Workspace #1670

Closed fvalentiner closed 5 months ago

fvalentiner commented 5 months ago

Context

Bounty: https://community.sphinx.chat/bounty/2009

Add Pagination, Filtering, Sorting and 3 more fields to the Get Features for Workspace endpoint

/workspaces/{workspace_uuid}/features

Design

We need to add:

Use the Database pagination and sorting function

offset, limit, sortBy, direction, search := utils.GetPaginationParams(r)

To the get features for workspace endpoint. GET /workspaces/{workspace_uuid}/features

Pagination Query Parameters limit=10 &page=1 &resetPage=true

Sorting Query Parameter &sortBy=priority, created

You can copy functionality for pagination and sorting from /gobounties/all endpoint where all this query parameters are implemented.

This changes in the endpoints are necessary to make this UI changes.

Current Design

image

New Design

image

Change DATABASE_URL to connect to your local DB (it could be an empty db)

Acceptance Criteria

AbdulWahab3181 commented 5 months ago

@fvalentiner Could you please assign me?

MahtabBukhari commented 5 months ago

@fvalentiner Could you please assign me?

MirzaHanan commented 5 months ago

Hi @fvalentiner, please assign me?