Hey there !
I am currently working on an app using Angular + Firebase.
When an user submit a form from the app, an item is created in a board (already did it and it works well).
I want to allow the users to add files in the form, so I need to be able to upload those files in the item in Monday.
I tried to do it the following way:
var file = this.filesList[0]
var itemId = myItemID;
var headers = new HttpHeaders({'authorization': environment.monday_token});
var option = {headers : headers}
var url = "https://api.monday.com/v2/file";
//The gql query
var addFileRequest = {"query" : "mutation($file: File!, $itemId: Int!, $columnId: String!)\\
{add_file_to_column(file:$file, item_id: $itemId, column_id: $columnId) \\
{ id }\\
}",
"variables" : {"file" : file, "itemId":itemId, "columnId":"file"}}
this.httpClient.post(url,addFileRequest, option).subscribe((snapshot:any) => {
console.log(snapshot);
});
When I execute the code above I got the logs in the browser console:
I’ve seen in others Topics that CORS issue happens when you’re trying to upload a file from client-side. So what are my others options here ? How could I proceed to avoid it then ?
Thank you for your help 🙂