mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix: handle Pydantic validation errors in notify + nullify empty optional fields
- getApiErrorMessage now formats Pydantic [{loc, msg}] arrays as readable strings
- LandingPaymentMethod description/icon_url nullable
- Send null instead of empty string for optional payment method fields
This commit is contained in:
@@ -406,7 +406,11 @@ export default function AdminLandingEditor() {
|
||||
|
||||
// Strip _id before sending to API
|
||||
const cleanFeatures: AdminLandingFeature[] = features.map(({ _id: _, ...rest }) => rest);
|
||||
const cleanMethods = paymentMethods.map(({ _id: _, ...rest }) => rest);
|
||||
const cleanMethods = paymentMethods.map(({ _id: _, ...rest }) => ({
|
||||
...rest,
|
||||
description: rest.description || null,
|
||||
icon_url: rest.icon_url || null,
|
||||
}));
|
||||
|
||||
// Filter out empty period arrays and periods for non-selected tariffs
|
||||
const cleanPeriods = Object.fromEntries(
|
||||
|
||||
Reference in New Issue
Block a user