Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MG - 41 - Refactor User enable and disable #113

Merged
merged 4 commits into from
Nov 29, 2024
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/wise-pears-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@absmach/magistrala-sdk": patch
---

This pr updates the users service to the latest jsdocs and also removes the need for passing a user to enable or disable the user.
18 changes: 7 additions & 11 deletions examples/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mySdk.users
mySdk.users
.Update(
{ id: "<userId>", first_name: "<firstName>", last_name: "<lastName>" },
token
token,
)
.then((response: any) => {
console.log("response: ", response);
Expand All @@ -85,7 +85,7 @@ mySdk.users
mySdk.users
.UpdateUsername(
{ id: "<userId>", credentials: { username: "<username>" } },
token
token,
)
.then((response: any) => {
console.log("response: ", response);
Expand All @@ -97,7 +97,7 @@ mySdk.users
mySdk.users
.UpdateProfilePicture(
{ id: "<userId>", profile_picture: "<profilePicture>" },
token
token,
)
.then((response: any) => {
console.log("response: ", response);
Expand Down Expand Up @@ -125,7 +125,7 @@ mySdk.users
});

mySdk.users
.Disable({ id: "<userId>" }, token)
.Disable("<userId>", token)
.then((response: any) => {
console.log("response: ", response);
})
Expand All @@ -134,7 +134,7 @@ mySdk.users
});

mySdk.users
.Enable({ id: "<userId>" }, token)
.Enable("<userId>", token)
.then((response: any) => {
console.log("response: ", response);
})
Expand Down Expand Up @@ -169,12 +169,8 @@ mySdk.users
console.error(error);
});

mySdk.users.ListUserClients(
"<domainId>",
"<userId>",
{ offset: 0, limit: 10 },
token,
)
mySdk.users
.ListUserClients("<domainId>", "<userId>", { offset: 0, limit: 10 }, token)
.then((response: any) => {
console.log("response: ", response);
})
Expand Down
Loading