I'm trying to console log to see what my posts are...
# help
m
I'm trying to console log to see what my posts are looking like by calling this function in my component that displays the data from the database
Copy code
const 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
Copy code
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?
s
This might be due to
.select
not having a value, try
.select('*')
instead.