I am trying to use code to move an uploaded file to a specific folder, using Velo code in the Wix Editor
Using the API reference, my backend code is as follows:
//id = "c00749_41449ed91b56430cbf84014b314543fb.pdf"
//file = { parentFolderId: 'aead776f902c4850888a0e12c5b4d33b' }
export const moveProofToFolder = webMethod(
Permissions.Anyone,
async (id, file) => {
try {
const elevatedUpdateFileDescriptor = elevate(files.updateFileDescriptor);
const updatedDescriptor = await elevatedUpdateFileDescriptor(id, file);
console.log("Updated:", updatedDescriptor);
return updatedDescriptor;
} catch (error) {
console.error(error);
// Handle the error
}
},
);
I receive the following error message: INVALID_ARGUMENT: options.fieldMask must be an array
Any ideas?