mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 01:31:12 -05:00
Implement type safety and JSONB elimination
This commit is contained in:
@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { useUserRole } from '@/hooks/useUserRole';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import {
|
||||
fetchSubmissionItems,
|
||||
buildDependencyTree,
|
||||
@@ -99,10 +100,10 @@ export function SubmissionReviewManager({
|
||||
.filter(item => item.status === 'pending')
|
||||
.map(item => item.id);
|
||||
setSelectedItemIds(new Set(pendingIds));
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: error.message || 'Failed to load submission items',
|
||||
description: getErrorMessage(error),
|
||||
variant: 'destructive',
|
||||
});
|
||||
} finally {
|
||||
@@ -138,10 +139,10 @@ export function SubmissionReviewManager({
|
||||
// No conflicts, proceed with approval
|
||||
handleApprove();
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: error.message || 'Failed to check dependencies',
|
||||
description: getErrorMessage(error),
|
||||
variant: 'destructive',
|
||||
});
|
||||
} finally {
|
||||
@@ -244,11 +245,11 @@ export function SubmissionReviewManager({
|
||||
|
||||
onComplete();
|
||||
onOpenChange(false);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Error approving items:', error);
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: error.message || 'Failed to approve items',
|
||||
description: getErrorMessage(error),
|
||||
variant: 'destructive',
|
||||
});
|
||||
} finally {
|
||||
@@ -299,11 +300,11 @@ export function SubmissionReviewManager({
|
||||
|
||||
onComplete();
|
||||
onOpenChange(false);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Error rejecting items:', error);
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: 'Failed to reject items. Please try again.',
|
||||
description: getErrorMessage(error),
|
||||
variant: 'destructive',
|
||||
});
|
||||
} finally {
|
||||
@@ -352,11 +353,11 @@ export function SubmissionReviewManager({
|
||||
|
||||
onComplete();
|
||||
onOpenChange(false);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Error escalating submission:', error);
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: error.message || 'Failed to escalate submission',
|
||||
description: getErrorMessage(error),
|
||||
variant: 'destructive',
|
||||
});
|
||||
} finally {
|
||||
@@ -419,11 +420,11 @@ export function SubmissionReviewManager({
|
||||
}
|
||||
|
||||
await loadSubmissionItems();
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Error changing item status:', error);
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: error.message || 'Failed to change item status',
|
||||
description: getErrorMessage(error),
|
||||
variant: 'destructive',
|
||||
});
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user