Rank 4: Virtual Machine
AppwriteException: Invalid document structure: Attribute "color" has invalid type. Value must be a valid string and no longer than 100 chars
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 4: Virtual Machine
AppwriteException: Invalid document structure: Attribute "color" has invalid type. Value must be a valid string and no longer than 100 chars
Rank 4: Virtual Machine
once check my code
so when radio button selects a value -> you should be sending that back to update the DB about the color, empty string will be replaced by your color. I do not think the updation is happening and hence, it is showing error?
Rank 4: Virtual Machine
then what should i change in my code
Rank 4: Virtual Machine
props.setSelectedValue(event.target.value); database({ color:'' }).then(function (response) { console.log(response); }, function (error) { console.log(error); });}const handleChange2 = (event)=>{ props.setSelectedValue2(event.target.value); database( { side:'' } ).then(function (response) { console.log(response); }, function (error) { console.log(error); });}```What logs you get for this part?
database({ color:'' }).then(function (response) { console.log(response); }, function (error) { console.log(error); });Rank 4: Virtual Machine
black and white
Rank 4: Virtual Machine
Or
Rank 4: Virtual Machine
Color
What is the log of the database function
Rank 4: Virtual Machine
What is log
Rank 4: Virtual Machine
Do you mean console log
Yes
Rank 4: Virtual Machine
Users radio button input
Do you get error when running the database function?
Rank 4: Virtual Machine
Yes
What is the error?
Rank 4: Virtual Machine
Show me the payload inside the network tab
Rank 4: Virtual Machine
Ok
Rank 4: Virtual Machine
Rank 4: Virtual Machine
here it is
Okay, you're sending color as an object when it is a string
Just change the value to string and you're good to go
closing as original message was deleted so i think it was resolved
[SOLVED] AppwriteException: Invalid document structure: Attribute "color" has invalid type.