Skip to content

Commit 4fced88

Browse files
bartlenaertsdimklLekoArts
authored
feat(backend): Add banUser to UserApi (clerk#2766)
* feature: added banUser to UserApi.ts * feature: added banUser to UserApi.ts * chore(repo): Update changeset --------- Co-authored-by: Dimitris Klouvas <dimitris@clerk.dev> Co-authored-by: LekoArts <lekoarts@gmail.com>
1 parent ee47182 commit 4fced88

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.changeset/soft-trees-battle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': minor
3+
---
4+
5+
Add `banUser` method to the User operations (accessible under `clerkClient.users`). Executes the [Ban a user](https://clerk.com/docs/reference/backend-api/tag/Users#operation/BanUser) backend API call.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,12 @@ export class UserAPI extends AbstractAPI {
236236
bodyParams: { code },
237237
});
238238
}
239+
240+
public async banUser(userId: string) {
241+
this.requireId(userId);
242+
return this.request<User>({
243+
method: 'POST',
244+
path: joinPaths(basePath, userId, 'ban'),
245+
});
246+
}
239247
}

0 commit comments

Comments
 (0)