enti
04/19/2022, 10:04 AMquestions
table with just a row of different questions. Each question can have different answers. Those are in a table answers
, containing a foreign key question_id
. I use an API call to get the structure I want :
js
let { data: questions, error } = await supabase
.from('questions')
.select(`
question,
answers(
answer
)
`)
json
[
{
"question": "question one",
"answers": [
{
"answer": "answer one for question one"
},
{
"answer": "answer two for question one"
}
]
},
{
"question": "question two",
"answers": [
{
"answer": "answer one for question two"
},
{
"answer": "answer two for question two"
}
]
}
]
But, for security reasons, I want to get the same result using a function and a RPC call. Unfortunately, I can't figure it out on my own. Is there a way to do it ?Needle
04/19/2022, 10:04 AM/title
command!
We have solved your problem?
Click the button below to archive it.Needle
04/19/2022, 1:25 PMNeedle
04/19/2022, 1:25 PM