mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-27 06:46:59 -05:00
Approve tool use
This commit is contained in:
@@ -46,7 +46,7 @@ import { Loader2, Trash } from 'lucide-react';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { submitTimelineEvent, submitTimelineEventUpdate, deleteTimelineEvent } from '@/lib/entitySubmissionHelpers';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { handleError } from '@/lib/errorHandler';
|
||||
import type {
|
||||
EntityType,
|
||||
TimelineEventFormData,
|
||||
@@ -170,12 +170,11 @@ export function TimelineEventEditorDialog({
|
||||
form.reset();
|
||||
onOpenChange(false);
|
||||
onSuccess?.();
|
||||
} catch (error) {
|
||||
console.error('Failed to submit timeline event:', error);
|
||||
toast({
|
||||
title: 'Submission failed',
|
||||
description: error instanceof Error ? error.message : 'Failed to submit timeline event',
|
||||
variant: 'destructive',
|
||||
} catch (error: unknown) {
|
||||
handleError(error, {
|
||||
action: isEditing ? 'Update Timeline Event' : 'Submit Timeline Event',
|
||||
userId: user?.id,
|
||||
metadata: { entityType, entityId }
|
||||
});
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
@@ -196,13 +195,11 @@ export function TimelineEventEditorDialog({
|
||||
onOpenChange(false);
|
||||
setShowDeleteConfirm(false);
|
||||
form.reset();
|
||||
} catch (error) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
console.error('Delete error:', errorMsg);
|
||||
toast({
|
||||
title: 'Failed to delete event',
|
||||
description: errorMsg,
|
||||
variant: 'destructive',
|
||||
} catch (error: unknown) {
|
||||
handleError(error, {
|
||||
action: 'Delete Timeline Event',
|
||||
userId: user?.id,
|
||||
metadata: { eventId: existingEvent?.id }
|
||||
});
|
||||
} finally {
|
||||
setIsDeleting(false);
|
||||
|
||||
Reference in New Issue
Block a user