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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: How can we use updateLabels? #7029

Closed
2 tasks done
SMARTMICROWORLD opened this issue Oct 27, 2023 · 3 comments
Closed
2 tasks done

馃悰 Bug Report: How can we use updateLabels? #7029

SMARTMICROWORLD opened this issue Oct 27, 2023 · 3 comments
Assignees
Labels
bug Something isn't working product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.

Comments

@SMARTMICROWORLD
Copy link

SMARTMICROWORLD commented Oct 27, 2023

馃憻 Reproduction steps

As mentioned in appwrite docs to use updateLabeles:

const sdk = require('node-appwrite');

const client = new sdk.Client()
    .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2')                 // Your project ID
    .setKey('98fd4...a2ad2');                    // Your secret API key

const users = new sdk.Users(client);

const promise = users.updateLabels(
    '[USER_ID]',
    [ 'subscriber' ]
);

promise.then(function (response) {
    console.log(response); // Success
}, function (error) {
    console.log(error); // Failure
});

馃憤 Expected behavior

It should update user labels

馃憥 Actual Behavior

It is not updating user labels

馃幉 Appwrite version

Appwrite Cloud

馃捇 Operating system

Linux

馃П Your Environment

No response

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@SMARTMICROWORLD SMARTMICROWORLD added the bug Something isn't working label Oct 27, 2023
@stnguyen90 stnguyen90 added the product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services. label Oct 27, 2023
@stnguyen90 stnguyen90 self-assigned this Oct 27, 2023
@stnguyen90
Copy link
Contributor

@SMARTMICROWORLD, thanks for raising this issue! 馃檹馃徏 Would you please share the logged result, whether it was the response or error?

@SMARTMICROWORLD
Copy link
Author

SMARTMICROWORLD commented Oct 28, 2023

@SMARTMICROWORLD, thanks for raising this issue! 馃檹馃徏 Would you please share the logged result, whether it was the response or error?

not getting any log also not getting suggestion of updateLabels after (users.suggestion Of UpdateLabeles) getting all other suggestions. Actually it is cloud function:

import {
Client,
Databases,
Account,
Functions,
ID,
Permission,
Query,
Users,
} from "node-appwrite";

const appwriteUsers = new Users(appwriteClient);

appwriteUsers.updateLabels(requestData.data.$id, "Premium");

got it I have installed node-appwrite 9.0.0 even after using npm i node-appwrite?
Removed node-appwrite 9.0.0 and installed again now it is 11.0.0, now it is working

@stnguyen90
Copy link
Contributor

Glad you figured it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.
Projects
None yet
Development

No branches or pull requests

2 participants