
I was getting the above error while trying to update database from server code I also included: *the key *the project ID *the document ID *the database ID *the collection ID

can you show network payload once?

also the code please?

okay

minusFromDb() async {
AppWriteLogic appwriteData = AppWriteLogic();
appwriteData.appwriteEndpointProjectID();
Future result = appwriteData.databases.updateDocument(
databaseId: appwriteData.databaseID.toString(),
collectionId: appwriteData.walletBalanceCollectionID.toString(),
// documentId: walletDocumentID.toString(),
documentId: "wallet_data_${userID}",
//
//
data: {"current_wallet_balance": 100},
);
//
result.then((response) {
print("object");
//
}).catchError((error) {
print(error);
});
}

Where are you running this from?

Dart cloud function @Steven

What is AppwriteLogic
and appwriteEndpointProjectID()
?

Appwrite class for holding my necessary details and functions

Please share the code

But is it healthy to use a frontend API?

String endpoint = "http://localhost/v1";
String projectId = 'project id';
String variablesKey =
"key from console";
String walletBalanceCollectionID = "wallet balance collection";
String databaseID = "database id";
// create account, function instance
Databases databases = Databases(client);
Functions functions = Functions(client);
late Account account;
// Functions functions = Functions(client);
// pass in secret data
appwriteEndpointProjectID() {
client
.setEndpoint(endpoint) // Your API Endpoint
.setProject(projectId) // ID
.setSelfSigned(status: true)
.setKey(variablesKey);
account = Account(client);
}
}

the values is qoutes were changed before posting for security reasons

Where's client initialized?

Also, your endpoint could be the problem. You can't use localhost because the function would connect to itself instead of Appwrite

It was, I didn't copy that part
It was initialized outside, since I can't initialize and use it in the class top level area at same time

oooo, it supposed to be the appwrite cloud url
what a mistake

That should work

what was that?
it's not a local instance of appwrite

Right...so what's your problem now?

I think it's sorted, but 8 need to try when next my laptop is turned on
Recommended threads
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
