Unrated-Limited-Unlimited / ua-frontend

Unrated Application
GNU General Public License v3.0
4 stars 0 forks source link

Add paging to "whiskey" page #43

Closed MikalDr closed 4 months ago

MikalDr commented 4 months ago

The endpoint has been updated in regards to paging on the backend.

On the frontend we need to add a option to change page, and load new whiskey.

DoD:

Acceptance Criteria:

MikalDr commented 4 months ago

getWhiskey(sortType: SortType, paging: Paging): [Whiskey]

paging {page, size}

MikalDr commented 4 months ago

This is impemented on the "grid-display" branch as infinite scrolling

MikalDr commented 4 months ago

@Veggissss when trying to query whiskey using paging, we get null.

line 58 in WhiskeyFetcher seems to fail. Please help 😄

10:59:37.666 [default-nioEventLoopGroup-1-11] WARN n.g.e.SimpleDataFetcherExceptionHandler - Exception while fetching data (/getWhiskeys) : null cannot be cast to non-null type kotlin.collections.Map<*, *> java.lang.NullPointerException: null cannot be cast to non-null type kotlin.collections.Map<*, *> at com.ulu.fetchers.WhiskeyFetcher.getWhiskeys$lambda$5(WhiskeyFetcher.kt:58) at graphql.execution.ExecutionStrategy.invokeDataFetcher(ExecutionStrategy.java:311) at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:287) at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213) at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55) at graphql.execution.Execution.executeOperation(Execution.java:161)

Veggissss commented 4 months ago

Woops, workin on it

Veggissss commented 4 months ago

Should be fixed now in the latest commit.

The sorting input was changed to:

getWhiskeys(
    sort: {sortType: PRICE, reverse: true}
)

As stated in this PR

MikalDr commented 4 months ago

@Veggissss we get data now :+1: seems to work

MikalDr commented 4 months ago

Tested with the running DB on the server. Seems to work. Closing as it is now complete