refactor code

This commit is contained in:
Max
2025-05-24 16:43:09 +03:00
parent ddcf27b022
commit 6b5ae7bce1

View File

@@ -7,7 +7,6 @@ async function initSupabaseClient() {
const supabaseUrl = await getSupabaseUrl(); const supabaseUrl = await getSupabaseUrl();
const supabaseAnonKey = await getSupabaseKey(); const supabaseAnonKey = await getSupabaseKey();
supabase = createClient(supabaseUrl, supabaseAnonKey); supabase = createClient(supabaseUrl, supabaseAnonKey);
return supabase;
} }
function getSupabaseClient() { function getSupabaseClient() {
@@ -16,7 +15,7 @@ function getSupabaseClient() {
} }
return supabase; return supabase;
} }
// POST /refresh-supabase-client // POST /refresh-supabase-client
router.post('/refresh-supabase-client', async (req, res) => { router.post('/refresh-supabase-client', async (req, res) => {
try { try {
@@ -31,7 +30,7 @@ try {
(async () => { (async () => {
await initSupabaseClient(); await initSupabaseClient();
})(); })();
module.exports = { module.exports = {
getSupabaseClient, getSupabaseClient,
}; };