Skip to content

Commit 7bb644a

Browse files
authored
feat(backend): Add orderBy to OAuthApplicationsApi (#6593)
1 parent 0ef92cf commit 7bb644a

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

.changeset/long-clowns-open.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': patch
3+
---
4+
5+
Add `orderBy` parameter to OAuth Applications list request

packages/backend/src/api/endpoints/OAuthApplicationsApi.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { DeletedObject } from '../resources';
55
import type { PaginatedResourceResponse } from '../resources/Deserializer';
66
import type { OAuthApplication } from '../resources/OAuthApplication';
77
import { AbstractAPI } from './AbstractApi';
8+
import type { WithSign } from './util-types';
89

910
const basePath = '/oauth_applications';
1011

@@ -36,8 +37,16 @@ type UpdateOAuthApplicationParams = CreateOAuthApplicationParams & {
3637
oauthApplicationId: string;
3738
};
3839

40+
type GetOAuthApplicationListParams = ClerkPaginationRequest<{
41+
/**
42+
* Sorts OAuth applications by name or created_at.
43+
* By prepending one of those values with + or -, we can choose to sort in ascending (ASC) or descending (DESC) order.
44+
*/
45+
orderBy?: WithSign<'name' | 'created_at'>;
46+
}>;
47+
3948
export class OAuthApplicationsApi extends AbstractAPI {
40-
public async list(params: ClerkPaginationRequest = {}) {
49+
public async list(params: GetOAuthApplicationListParams = {}) {
4150
return this.request<PaginatedResourceResponse<OAuthApplication[]>>({
4251
method: 'GET',
4352
path: basePath,

0 commit comments

Comments
 (0)