Git Product home page Git Product logo

Comments (3)

nnabuuu avatar nnabuuu commented on May 24, 2024

I don't think there is a way to achieve this now. But I believe we can have this feature in the future. (Introduce extra parameter for requestAll may be helpful)

from node-zendesk.

nnabuuu avatar nnabuuu commented on May 24, 2024

Hi @blakmatrix ,
I am thinking about the way to support user handle page of their own.

in zendesk's develop site, it is already offered that if we pass 2 parameters per_page and page, then list method will return corresponding result. And, I have tried your request method, calling it like this.request('GET', ['categories'], {per_page: 10, page: 2}, cb) will return exactly want he expects.

So, I am thinking of the following:

Way 1. We make another option like extraOptions.autoPageHandling: false, and if that happen, requestAll = request, then we use ways like Array.prototype.concat.call(['GET', ['categories']], Array.prototype.slice.call(arguments)); to create the arguments this.request('GET', ['categories'], {per_page: 10, page: 2}, cb)

Way 2. We dynamically judge by arguments, if the last 1st or 2nd object is {per_page: ?? , page: ??}, then we call request, otherwise we call requestAll.

However, both way need to change code a lot : (

Any comment?

from node-zendesk.

blakmatrix avatar blakmatrix commented on May 24, 2024

I for a while have wanted to refactor this library, that being said though, I feel we should expose an option to disable autopaging, If I were to go back, the option would have been reverse, that auto-paging would have been a feature rather than a default.

I almost feel like the most straightforward approach might be to just increment the major form here, enforce options object to be sent (or assumed empty -- unless we expose methods to change default options) and a option to turn auto-paging on with the default being off. I agree, I think anyway we cut it it's going to be a major change, and if that's the case I'd like to also adress some of the other open issues here and considerations on how Zendesks API has been changing as well and refactor accordingly. I wanted to move away from nconf as it is no longer maintained adressing the concerns in #36 .

from node-zendesk.

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.