Skip to content

Commit

Permalink
MG-41 - Refactor User enable and disable (#113)
Browse files Browse the repository at this point in the history
* update users service

Signed-off-by: ianmuchyri <[email protected]>

* add changeset

Signed-off-by: ianmuchyri <[email protected]>

* update tests

Signed-off-by: ianmuchyri <[email protected]>

* update jsdocs type

Signed-off-by: ianmuchyri <[email protected]>

---------

Signed-off-by: ianmuchyri <[email protected]>
  • Loading branch information
ianmuchyri authored Nov 29, 2024
1 parent 8e06062 commit 3d97973
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 379 deletions.
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

0 comments on commit 3d97973

Please sign in to comment.