feat: download campaign report

This commit is contained in:
Abhishek Kumar 2026-03-11 17:57:04 +05:30
parent ff92c6ae5c
commit 4d807266a7
12 changed files with 429 additions and 28 deletions

View file

@ -131,8 +131,10 @@ export function UserConfigProvider({ children }: { children: ReactNode }) {
});
if (response.error) {
let msg = 'Failed to save user configuration';
const detail = (response.error as unknown as { detail?: { errors: { model: string; message: string }[] } }).detail;
if (Array.isArray(detail)) {
const detail = (response.error as unknown as { detail?: string | { errors: { model: string; message: string }[] } }).detail;
if (typeof detail === 'string') {
msg = detail;
} else if (Array.isArray(detail)) {
msg = detail
.map((e: { model: string; message: string }) => `${e.model}: ${e.message}`)
.join('\n');