mathurah
01/31/2022, 2:36 AMconst getPosts = async () => {
const response = await getAllPosts();
console.log("this is response", response);
// return response;
};
which refers to this function in my backend supabase.js
file
export const getAllPosts = async () => {
const { data: posts, error } = await supabase
.from("post")
.select()
.order("created_at", { ascending: false });
if (error) {
handleError(error);
}
console.log(posts);
return posts;
};
but when I console log, I just see this in the console - is there anyway I can get access to the data I'm returning - am I writing this getPosts function wrong here?silentworks
01/31/2022, 7:09 AM.select
not having a value, try .select('*')
instead.