change request
This commit is contained in:
@@ -5,23 +5,21 @@ const { getSupabaseClient } = require('../supabaseClient');
|
|||||||
router.get('/profile', async (req, res) => {
|
router.get('/profile', async (req, res) => {
|
||||||
const { user_id } = req.body;
|
const { user_id } = req.body;
|
||||||
const supabase = getSupabaseClient();
|
const supabase = getSupabaseClient();
|
||||||
const { data, error } = await supabase.from('user_profiles').select(`
|
const { data, error } = await supabase.from('users').select(`
|
||||||
id,
|
id,
|
||||||
full_name,
|
phone,
|
||||||
avatar_url,
|
user_profiles(full_name,avatar_url,updated_at)
|
||||||
updated_at,
|
|
||||||
users(phone)
|
|
||||||
`).eq('id', user_id);
|
`).eq('id', user_id);
|
||||||
console.log('@@@@@@@@@@@@@@@@@@@@@@@@');
|
console.log('@@@@@@@@@@@@@@@@@@@@@@@@');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (error) return res.status(400).json({ error: error.message });
|
if (error) return res.status(400).json({ error: error.message });
|
||||||
res.json({
|
res.json({
|
||||||
id: data.id,
|
id: data.id,
|
||||||
username: data.full_name,
|
username: data.user_profiles.full_name,
|
||||||
avatar_url: data.avatar_url,
|
avatar_url: data.user_profiles.avatar_url,
|
||||||
phone: data.users.phone,
|
phone: data.phone,
|
||||||
apartment: '9',
|
apartment: '9',
|
||||||
updated_at: data.updated_at
|
updated_at: data.user_profiles.updated_at
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user