Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Remove total field in Pager, add count fn. #50

Merged
merged 5 commits into from
Nov 5, 2019

Conversation

n1k0
Copy link
Collaborator

@n1k0 n1k0 commented Nov 5, 2019

This patch removes the total field of the Pager record type, because it's not available anymore for GET request in Kinto but only through an HEAD one. See related Kinto discussion here.

That's why the patch also adds a new count function so users can separately retrieve the total number of records available in a given collection.

This is gonna trigger a major release:

$ elm diff
This is a MAJOR change.

---- Kinto - MAJOR ----

    Added:
        count :
            Kinto.Resource a
            -> (Result.Result Kinto.Error Basics.Int -> msg)
            -> Kinto.Client
            -> Kinto.Request msg
    
    Changed:
      - type alias Pager a =
            { client : Client
            , objects : List a
            , decoder : Decoder (List a)
            , total : Int
            , nextPage : Maybe Url
            }
      + type alias Pager a =
            { client : Kinto.Client
            , objects : List.List a
            , decoder : Json.Decode.Decoder (List.List a)
            , nextPage : Maybe.Maybe Kinto.Url
            }

@n1k0 n1k0 requested review from Natim and magopian November 5, 2019 14:10
@n1k0 n1k0 self-assigned this Nov 5, 2019
@n1k0
Copy link
Collaborator Author

n1k0 commented Nov 5, 2019

I need to update the examples.

src/Kinto.elm Outdated Show resolved Hide resolved
Copy link
Member

@Natim Natim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top merci!

@n1k0 n1k0 merged commit 3c12bf1 into master Nov 5, 2019
@n1k0 n1k0 deleted the deprecate-pager-total-field branch November 5, 2019 16:01
@magopian
Copy link
Collaborator

magopian commented Nov 5, 2019

Flawless 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants