fix(i-d): notifications-DELETE + agents/skills Brueche — tote Hooks eliminiert
Verifiziert: useDeleteNotification und useAgentSkills haben NULL Komponenten-Importeure (nur Definitionsdateien). Die echten Komponenten nutzen andere Hooks (useNotifications, useMarkNotificationRead, useUnreadNotificationCount; useAgentTools/useAgentToolsFull). Nach AGENTS.md 0.2 keine Backend-Shims fuer tote Calls: beide Hooks entfernt, ungenutztes apiDelete-Import in notifications.ts bereinigt. Damit sind alle 12 API-Braeche aus dem D5-Triage abgeschlossen: ai/sessions x5 (3e5f13f), policies x4 (86c96f0), mail x4 (86c96f0), notifications DELETE (hier), agents/skills (hier). tsc exit=0.
This commit is contained in:
@@ -16,7 +16,6 @@ import type {
|
||||
AutomationSettings,
|
||||
MiniAppDef,
|
||||
AgentToolInfo,
|
||||
AgentSkillInfo,
|
||||
AgentRunFull,
|
||||
} from '@/types/automation';
|
||||
|
||||
@@ -258,16 +257,6 @@ export function useAgentToolsFull() {
|
||||
});
|
||||
}
|
||||
|
||||
export function useAgentSkills() {
|
||||
return useQuery({
|
||||
queryKey: ['agentSkills'],
|
||||
queryFn: async () => {
|
||||
const res = await apiGet<AgentSkillInfo[] | { items: AgentSkillInfo[] }>('/agents/skills');
|
||||
return Array.isArray(res) ? res : res.items ?? [];
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function useAgentRunsFull(agentId: string) {
|
||||
return useQuery({
|
||||
queryKey: ['agentRunsFull', agentId],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { apiGet, apiPatch, apiDelete } from './client';
|
||||
import { apiGet, apiPatch } from './client';
|
||||
import { PaginatedResponse } from './types';
|
||||
|
||||
// ── Types matching backend schemas ──
|
||||
@@ -64,16 +64,6 @@ export function useMarkNotificationRead() {
|
||||
});
|
||||
}
|
||||
|
||||
export function useDeleteNotification() {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (id: string) => apiDelete(`/notifications/${id}`),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['notifications'] });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function useNotificationTypes() {
|
||||
return useQuery({
|
||||
queryKey: ['notification-types'],
|
||||
|
||||
Reference in New Issue
Block a user