fix(products): ordenar produtos do maior para o menor preco, permitir limpar input de preco/stock sem ficar negativo, e impedir adicionar mais quantidade ao carrinho do que o stock disponivel
This commit is contained in:
24
test_supabase.js
Normal file
24
test_supabase.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config({ path: './web/.env' });
|
||||
|
||||
const supabaseUrl = process.env.VITE_SUPABASE_URL;
|
||||
const supabaseKey = process.env.VITE_SUPABASE_ANON_KEY;
|
||||
|
||||
if (!supabaseUrl || !supabaseKey) {
|
||||
console.log("Missing Supabase credentials in .env");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const supabase = createClient(supabaseUrl, supabaseKey);
|
||||
|
||||
async function test() {
|
||||
console.log("Checking notifications table...");
|
||||
const { data, error } = await supabase.from('notifications').select('*').limit(1);
|
||||
if (error) {
|
||||
console.error("Error accessing notifications table:", error.message);
|
||||
} else {
|
||||
console.log("Notifications table exists!");
|
||||
}
|
||||
}
|
||||
test();
|
||||
Reference in New Issue
Block a user