const handleChange = (event) => {
event.preventDefault();
props.setSelectedValue(event.target.value);
const client = new Client()
client.setEndpoint('https://api.printfc.in/v1') // Your API Endpoint
.setProject('64242c801cdd58d2213');
const databases = new Databases(client);
const promise = databases.createDocument(
'6426fd4b827fedc4a235',
'6426fd9b65c0b7f2c561',
ID.unique(),
{
opt1,
opt2,
opt3,
opt4,
}
);
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
};
what is the type of the selected-value?
string
there is the error
{ "selected-value": "your fields here"
}
where should i add it
this is not a valid json:
{
opt1,
opt2,
opt3,
opt4,
}
??
`const handleChange = (event) => { event.preventDefault(); props.setSelectedValue(event.target.value); const client = new Client() client.setEndpoint('https://api.printfc.in/v1%27) // Your API Endpoint .setProject('64242c801cdd58d2213'); const databases = new Databases(client); const promise = databases.createDocument( '6426fd4b827fedc4a235', '6426fd9b65c0b7f2c561', ID.unique(), { "selected-value": "your fields here" } );
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
};`
what should i replace in "your fields here"
`const handleChange = (event) => { event.preventDefault(); props.setSelectedValue(event.target.value); const client = new Client() client.setEndpoint('https://api.printfc.in/v1%27) // Your API Endpoint .setProject('64242c801cdd58d2213'); const databases = new Databases(client); const promise = databases.createDocument( '6426fd4b827fedc4a235', '6426fd9b65c0b7f2c561', ID.unique(), { "selected-value": "{userId:12345,numberPages:10,numberCopies:2,Colorful:true,BothSides:false,fileId:abcdefg}" } );
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
};`
what value should i replace in userId and fileId
and should i set numpagesand etc to default
the fields you want to store
where does that fields present
no website
???
What is your frontend programmed for?
to upload files and to input the values
Hi @Bharath if no extra help is needed here can we close this?
I think you have mentioned wrong guy 🙂
Sorry!
My apologies
[solved] 400() error....
[SOLVED] 400() error....
Recommended threads
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...