Error when updating a string attribute using dart sdk
- 2
- Flutter
- Web
- Databases
- Cloud
- Self Hosted
AppwriteException: general_argument_invalid, Param "default" is not optional. (400)
cc: @D5 We are using dart-sdk for performing this sync
Here is a code snippet for the same:
await dest.databases.updateStringAttribute(
databaseId: databaseId,
collectionId: collectionId,
key: attributeA.key,
size: attributeA.size!,
xrequired: attributeA.required,
xdefault:
attributeA.required ? null : (attributeA.defaultValue ?? ''),
);
if I write the xdefault
part like this:
xdefault: attributeA.defaultValue ?? '',
I get this error:
AppwriteException: attribute_default_unsupported, Cannot set default value for required attribute (400)
Hmm I think it can't be nul as it needs to be true or false?
Recommended threads
- How to implement webhook on particular c...
I have a collection where I want to call the API if an entry is added. But, as of now, I don't see the option to choose in which collection if the entry is adde...
- Indexes using relationship
Hello there ! <:appwritecheers:892495536823861258> I was playing around with Database, Collections & Documents and I found an "issue" which isn't realy an iss...
- HTTPSConnectionPool(host='cloud.appwrite...
Hello guys, I have a function which should update documents in a database. During that update phase I am facing this error: ```Error updating notifications: HT...