diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/misc/utils.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts index b5bf99be2..b9aa223cf 100644 --- a/client/src/app/shared/misc/utils.ts +++ b/client/src/app/shared/misc/utils.ts | |||
@@ -66,6 +66,11 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) { | |||
66 | 66 | ||
67 | if (obj[key] === undefined) continue | 67 | if (obj[key] === undefined) continue |
68 | 68 | ||
69 | if (Array.isArray(obj[key]) && obj[key].length === 0) { | ||
70 | fd.append(key, null) | ||
71 | continue | ||
72 | } | ||
73 | |||
69 | if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { | 74 | if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { |
70 | objectToFormData(obj[ key ], fd, key) | 75 | objectToFormData(obj[ key ], fd, key) |
71 | } else { | 76 | } else { |