I have a membership site. One of the member pages allows the user to submit data to a collection I made.
It works provided you are admin. If not, it returns an error.
My first assumption was that is has to do with permissions of the collection being written to, so I changed the use to “CUSTOM” and changed all the permissions to “Anyone”. Not at all secure, but I wanted to prove that the error wasn’t here so I went to the extreme. But even with these slack permissions, Non admin members can still not submit data.
I can’t check this in “preview” mode, as preview mode will always preview you as the admin.
In chrome dev tools it gives me an error in red : “save operation failed” : " supplementaryErrorHandlers.js:22"
I have no weird code or anything, and submission is done through the wix GUI so no collection writing is dont here anyway. But here it is in case it may help:
Would be grateful for any ideas.
Thanks
import wixData from 'wix-data';
$w.onReady(function () {
});
//Generic Filter: Filters a dataset by given catagory, based on value of a dropdown.
function filter(name, dropDown, dataSet){
let newFilter = wixData.filter();
newFilter = newFilter.contains(name, dropDown);
$w(dataSet).setFilter(newFilter)
//newFilter = newFilter.contains("plantType", $w('#plantType').value);
//$w('#dataset5').setFilter(newFilter)
}
export function plantType_change_1(event) {
if ($w('#plantType').value !== "Grass") {
$w('#dropdown6').expand();
}
let name = "plantType";
let dropDown = $w('#plantType').value;
let dataSet = "#dataset5";
filter(name, dropDown, dataSet);
}
// Displays the relevant plant image from the Garden Database
export function dropdown6_change(event) {
wixData.query("GardenDataBase")
.eq("plantName", $w('#dropdown6').value)
.find()
.then((results)=> {
const firstItem = results.items[0]
const linkToImage = firstItem.plantImage // linkToImage is a string with the url to you image. Good for "$w('yourImage').src = linkToImage"
$w('#image17').src = linkToImage;
console.log(linkToImage)
console.log("123")
}
);
$w('#input2').expand();
$w('#image17').expand();
}