feat: implement market page with QueryProvider and dynamic listings
- wrap root layout with QueryProvider for React Query - replace market UnderConstruction placeholder with MarketClient and real data fetching - implement search, pagination, and sort via search params using getActiveListings - add necessary client components and queries - update dependencies (e.g., prisma, pkg-types)
This commit is contained in:
1 parent
55eebde0ba
commit
ab37b477df
106 files changed
+15261
-301
No files matched your search
+28
-5
@@ -74,11 +74,34 @@ export async function query<T = any>(
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error("❌ Erro ao executar query:", {
|
||||
query: text.substring(0, 100),
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
} catch (error: any) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
const errorCode = error?.code;
|
||||
const errorStack = error instanceof Error ? error.stack : undefined;
|
||||
|
||||
// Ignorar silenciosamente erros relacionados à tabela "items" não existir
|
||||
// Isso é esperado durante a transição e já está sendo tratado nas funções
|
||||
const isItemsTableMissing =
|
||||
errorCode === "42P01" &&
|
||||
(errorMessage.includes('relation "items" does not exist') ||
|
||||
text.includes('FROM items') ||
|
||||
text.includes('FROM "items"'));
|
||||
|
||||
// Não logar erros esperados sobre tabela items não existir
|
||||
if (!isItemsTableMissing) {
|
||||
console.error("❌ Erro ao executar query:", {
|
||||
query: text.substring(0, 200),
|
||||
error: errorMessage,
|
||||
stack: errorStack,
|
||||
});
|
||||
|
||||
// Se o erro for sobre coluna não existir, sugerir executar migração
|
||||
if (errorMessage.includes("column") && errorMessage.includes("does not exist")) {
|
||||
console.error("\n💡 DICA: Parece que a migração do banco de dados não foi executada.");
|
||||
console.error(" Execute: pnpm run db:migrate\n");
|
||||
}
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user