Skip to content

Commit

Permalink
deprecate delete user endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Nov 7, 2023
1 parent 6a85445 commit 41c6338
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions __tests__/users.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,9 @@ describe("user API", () => {
});

it("delete", async () => {
const response = await client.deleteUser({ userId: newUser.id });
const response = await client.deleteUsers({ user_ids: [newUser.id] });

expect(response.user?.id).toBe(newUser.id);
expect(response.user?.custom.color).toBe("blue");
expect(response).toBeDefined();
});

afterAll(async () => {
Expand Down
5 changes: 5 additions & 0 deletions src/StreamClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ export class StreamClient {
return this.usersApi.deactivateUsers({ deactivateUsersRequest });
};

/**
* @deprecated use `deleteUsers` instead
* @param deleteUsersRequest
* @returns
*/
deleteUser = async (request: DeleteUserRequest) => {
const response = await this.usersApi.deleteUser(request);
response.user = this.mapCustomDataAfterReceive(response.user);
Expand Down

0 comments on commit 41c6338

Please sign in to comment.