Giter VIP home page Giter VIP logo

Comments (7)

sharpner avatar sharpner commented on September 4, 2024

http://jsonapi.org/extending/ has an example about pagination at the bottom, it introduces after, before and limit, as alternate suggestions to skip and limit, which fixes the problem with "jumping items" on page change.

from api2go.

lucas-clemente avatar lucas-clemente commented on September 4, 2024

What do you think about passing the query parameters through to the datasource?

from api2go.

sharpner avatar sharpner commented on September 4, 2024

Well, they don't have to be parameters of the function. But I would provide utility functions in order to get those, if set.

What do you think?

I would love to have this as api2go feature. Maybe we can find a comfortable solution?

Something like.. SetPageLimit(25).. GetStartItem() string; GetToItem() string;

from api2go.

wwwdata avatar wwwdata commented on September 4, 2024

we could standardize the possible query parameters in my opinion. Put them all into a new struct and pass that struct as a parameter to findAll

from api2go.

lucas-clemente avatar lucas-clemente commented on September 4, 2024

I'm not sure standardizing query params makes sense. What do we provide – limit, order (desc / asc), order_col, offset, searchterm, …? These things might be highly application-dependant, so I'd say a map[string]string is the simplest and most general solution.

from api2go.

wwwdata avatar wwwdata commented on September 4, 2024

Hm yes i think you are right. Let's do it that way then.

from api2go.

sharpner avatar sharpner commented on September 4, 2024

yeah that sounds good.

from api2go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.