Efizzz
04/14/2022, 8:38 PMjavascript
const insertListing = async () => {
try {
const { data, error } = await client
.from("product")
.insert([{ title: "hello" }], { returning: "minimal" });
console.log(data || error);
} catch (error) {
alert(error.message);
}
};
I see that I am an authenticated user in the session when I run the function
And I can see that I am hitting the API:
200 OPTIONS /rest/vi/product
But I get an error in my console:
FetchError: Failed to fetch
Not sure what it's trying to fetch if minimal is on... and this is an insert any way. Should this be an OPTIONS rather than POST?Needle
04/14/2022, 8:38 PM/title
command!
We have solved your problem?
Click the button below to archive it.garyaustin
04/14/2022, 9:33 PMNeedle
04/14/2022, 9:33 PMtourdownunder
04/14/2022, 9:52 PMEfizzz
04/14/2022, 9:56 PMEfizzz
04/14/2022, 9:57 PMEfizzz
04/14/2022, 9:57 PMEfizzz
04/14/2022, 9:58 PMgaryaustin
04/14/2022, 9:58 PMEfizzz
04/14/2022, 10:00 PMEfizzz
04/14/2022, 10:00 PM{
"headers": [
{
"cf_cache_status": "DYNAMIC",
"cf_ray": "6fbfb54bc67318ee-EWR",
"content_length": "0",
"content_location": null,
"content_range": null,
"content_type": null,
"date": "Thu, 14 Apr 2022 21:59:22 GMT",
"transfer_encoding": null,
"x_kong_proxy_latency": null,
"x_kong_upstream_latency": null
}
],
"origin_time": 72,
"status_code": 200
}
Efizzz
04/14/2022, 10:01 PMgaryaustin
04/14/2022, 10:04 PMEfizzz
04/14/2022, 10:05 PMEfizzz
04/14/2022, 10:07 PMgaryaustin
04/14/2022, 10:12 PMgaryaustin
04/14/2022, 10:13 PMEfizzz
04/14/2022, 10:17 PMEfizzz
04/14/2022, 10:17 PMEfizzz
04/14/2022, 10:17 PMgaryaustin
04/14/2022, 10:23 PMEfizzz
04/14/2022, 10:26 PMEfizzz
04/14/2022, 10:26 PMEfizzz
04/14/2022, 10:27 PMEfizzz
04/14/2022, 10:27 PMEfizzz
04/14/2022, 10:27 PMEfizzz
04/14/2022, 10:27 PMEfizzz
04/14/2022, 10:28 PMgaryaustin
04/14/2022, 10:29 PMgaryaustin
04/14/2022, 10:31 PMEfizzz
04/14/2022, 10:32 PMEfizzz
04/14/2022, 10:32 PMgaryaustin
04/14/2022, 10:34 PMEfizzz
04/14/2022, 10:35 PMEfizzz
04/14/2022, 10:35 PMEfizzz
04/14/2022, 10:35 PMgaryaustin
04/14/2022, 10:36 PMEfizzz
04/14/2022, 10:36 PMEfizzz
04/14/2022, 10:37 PMEfizzz
04/14/2022, 10:38 PMEfizzz
04/14/2022, 10:38 PMgaryaustin
04/14/2022, 10:38 PMgaryaustin
04/14/2022, 10:40 PM