Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/long-clowns-open.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/backend': patch
---

Add `orderBy` parameter to OAuth Applications list request
11 changes: 10 additions & 1 deletion packages/backend/src/api/endpoints/OAuthApplicationsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { DeletedObject } from '../resources';
import type { PaginatedResourceResponse } from '../resources/Deserializer';
import type { OAuthApplication } from '../resources/OAuthApplication';
import { AbstractAPI } from './AbstractApi';
import type { WithSign } from './util-types';

const basePath = '/oauth_applications';

Expand Down Expand Up @@ -36,8 +37,16 @@ type UpdateOAuthApplicationParams = CreateOAuthApplicationParams & {
oauthApplicationId: string;
};

type GetOAuthApplicationListParams = ClerkPaginationRequest<{
/**
* Sorts OAuth applications by name or created_at.
* By prepending one of those values with + or -, we can choose to sort in ascending (ASC) or descending (DESC) order.
*/
orderBy?: WithSign<'name' | 'created_at'>;
}>;

export class OAuthApplicationsApi extends AbstractAPI {
public async list(params: ClerkPaginationRequest = {}) {
public async list(params: GetOAuthApplicationListParams = {}) {
return this.request<PaginatedResourceResponse<OAuthApplication[]>>({
method: 'GET',
path: basePath,
Expand Down
Loading