import type { ServiceResult } from '@/services/errorHandler' /** * Turns a ServiceResult into a thrown error for TanStack Query, * or returns the success payload. */ export const unwrapService = (result: ServiceResult): T => { if (result.ok) return result.data throw result.error }