Skip to content

Commit

Permalink
Fix pagination order parameter (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbvolta authored Mar 25, 2024
1 parent 1545960 commit 2522b5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/com/workos/common/http/PaginationParams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ open class PaginationParams @JvmOverloads constructor(
/**
* Sets the `order` query parameter.
*/
fun order(order: Order) = apply { this.params["order"] = order.toString() }
fun order(order: Order) = apply { this.params["order"] = order.type }

/**
* Creates an instance of T with the given builder parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class PaginationParamsTest {

assertEquals(params["after"], "after")
assertEquals(params["before"], "before")
assertEquals(params["order"], "desc")
assertEquals(params["limit"], "10")
}
}

0 comments on commit 2522b5e

Please sign in to comment.