Skip to content

Commit

Permalink
On the remote form, if a field is set to "", set it to null. (#306) (#…
Browse files Browse the repository at this point in the history
…307)

(cherry picked from commit 010bef1)

Co-authored-by: David Newswanger <[email protected]>
  • Loading branch information
patchback[bot] and newswangerd authored Feb 17, 2021
1 parent 153254b commit 45fec6d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api/remotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ class API extends BaseAPI {
delete reducedData['auth_url'];
}

for (const field of Object.keys(reducedData)) {
if (reducedData[field] === '') {
reducedData[field] = null;
}
}

return this.http.put(
`content/${distribution}/v3/sync/config/`,
reducedData,
Expand Down

0 comments on commit 45fec6d

Please sign in to comment.