26 lines
479 B
TypeScript
26 lines
479 B
TypeScript
import { useEffect, useState } from 'react';
|
|
|
|
import { supabase } from '../supabaseClient';
|
|
|
|
export const useJoinTest = () => {
|
|
const [test_data, setTestData] = useState(null);
|
|
|
|
async function getPartyEvents() {
|
|
const { data, error } = await supabase.from('countries').select(`
|
|
id,
|
|
name,
|
|
cities ( id, name )
|
|
`);
|
|
|
|
console.log({ data });
|
|
|
|
setTestData(data);
|
|
}
|
|
|
|
useEffect(() => {
|
|
getPartyEvents();
|
|
}, []);
|
|
|
|
return [test_data];
|
|
};
|