feat(sdk): Replace mock data with real API calls in consent, DSR, and consent-management
- /sdk/consent: Replace hardcoded mockDocuments with GET /api/admin/consent/documents - /sdk/dsr: Replace createMockDSRList with fetchSDKDSRList via /api/sdk/v1/dsgvo/dsr - /sdk/dsr/new: Replace console.log mock with real POST to create DSR requests - /sdk/dsr/[requestId]: Replace mock lookup with real GET/PUT for DSR details and status updates - /sdk/consent-management: Add real stats, GDPR process counts, and email template editor - lib/sdk/dsr/api.ts: Add transformBackendDSR adapter (flat backend → nested frontend types) Prepares for removal of /dsgvo and /compliance pages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
isOverdue,
|
||||
isUrgent
|
||||
} from '@/lib/sdk/dsr/types'
|
||||
import { createMockDSRList, createMockStatistics } from '@/lib/sdk/dsr/api'
|
||||
import { fetchSDKDSRList } from '@/lib/sdk/dsr/api'
|
||||
import { DSRWorkflowStepperCompact } from '@/components/sdk/dsr'
|
||||
|
||||
// =============================================================================
|
||||
@@ -323,17 +323,14 @@ export default function DSRPage() {
|
||||
const [selectedStatus, setSelectedStatus] = useState<DSRStatus | 'all'>('all')
|
||||
const [selectedPriority, setSelectedPriority] = useState<string>('all')
|
||||
|
||||
// Load data
|
||||
// Load data from SDK backend
|
||||
useEffect(() => {
|
||||
// For now, use mock data. Replace with API call when backend is ready.
|
||||
const loadData = async () => {
|
||||
setIsLoading(true)
|
||||
try {
|
||||
// In production: const data = await fetchDSRList()
|
||||
const mockRequests = createMockDSRList()
|
||||
const mockStats = createMockStatistics()
|
||||
setRequests(mockRequests)
|
||||
setStatistics(mockStats)
|
||||
const { requests: dsrRequests, statistics: dsrStats } = await fetchSDKDSRList()
|
||||
setRequests(dsrRequests)
|
||||
setStatistics(dsrStats)
|
||||
} catch (error) {
|
||||
console.error('Failed to load DSR data:', error)
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user