mirror of
https://github.com/lucasrcsantana/story-generator.git
synced 2025-12-16 21:37:51 +00:00
feat: implementa sistema de deleção de histórias
Some checks failed
Docker Build and Push / build (push) Has been cancelled
Some checks failed
Docker Build and Push / build (push) Has been cancelled
- Adiciona modal de confirmação de deleção - Implementa limpeza em cascata de recursos - Otimiza remoção de arquivos no storage - Adiciona feedback visual do processo - Melhora tratamento de erros - Implementa navegação pós-deleção
This commit is contained in:
parent
e23914657f
commit
745f8de40e
@ -13,9 +13,6 @@ export function ProtectedRoute({ children, allowedRoles = [] }: ProtectedRoutePr
|
|||||||
const { user, loading, userRole } = useAuth();
|
const { user, loading, userRole } = useAuth();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
console.log('ProtectedRoute - User:', user?.user_metadata);
|
|
||||||
console.log('ProtectedRoute - UserRole do contexto:', userRole);
|
|
||||||
console.log('ProtectedRoute - Roles permitidas:', allowedRoles);
|
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <div>Carregando...</div>;
|
return <div>Carregando...</div>;
|
||||||
@ -28,7 +25,6 @@ export function ProtectedRoute({ children, allowedRoles = [] }: ProtectedRoutePr
|
|||||||
|
|
||||||
// Pegar o role diretamente dos metadados do usuário
|
// Pegar o role diretamente dos metadados do usuário
|
||||||
const currentRole = user.user_metadata?.role;
|
const currentRole = user.user_metadata?.role;
|
||||||
console.log('ProtectedRoute - Role dos metadados:', currentRole);
|
|
||||||
|
|
||||||
// Se não houver roles requeridas, permite acesso
|
// Se não houver roles requeridas, permite acesso
|
||||||
if (allowedRoles.length === 0) {
|
if (allowedRoles.length === 0) {
|
||||||
|
|||||||
@ -450,8 +450,7 @@ export function StoryPage() {
|
|||||||
|
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
||||||
// Log para debug
|
|
||||||
console.log('Recordings fetched:', data);
|
|
||||||
|
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
setRecordings(data);
|
setRecordings(data);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user