diff options
author | 2021-09-14 19:58:52 +0200 | |
---|---|---|
committer | 2021-09-14 19:58:52 +0200 | |
commit | 95df3522a15631abc51a4295cae0ea401a8d4e1e (patch) | |
tree | e5eb0f368c947683f01458e912f21756fb0d99cb /src/internal-server/app/Middleware/ConvertEmptyStringsToNull.js | |
parent | docs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff) | |
download | ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip |
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to 'src/internal-server/app/Middleware/ConvertEmptyStringsToNull.js')
-rw-r--r-- | src/internal-server/app/Middleware/ConvertEmptyStringsToNull.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/internal-server/app/Middleware/ConvertEmptyStringsToNull.js b/src/internal-server/app/Middleware/ConvertEmptyStringsToNull.js index 87f1f6c25..9591cdc41 100644 --- a/src/internal-server/app/Middleware/ConvertEmptyStringsToNull.js +++ b/src/internal-server/app/Middleware/ConvertEmptyStringsToNull.js | |||
@@ -1,6 +1,6 @@ | |||
1 | class ConvertEmptyStringsToNull { | 1 | class ConvertEmptyStringsToNull { |
2 | async handle({ request }, next) { | 2 | async handle({ request }, next) { |
3 | if (Object.keys(request.body).length) { | 3 | if (Object.keys(request.body).length > 0) { |
4 | request.body = Object.assign( | 4 | request.body = Object.assign( |
5 | ...Object.keys(request.body).map(key => ({ | 5 | ...Object.keys(request.body).map(key => ({ |
6 | [key]: request.body[key] !== '' ? request.body[key] : null, | 6 | [key]: request.body[key] !== '' ? request.body[key] : null, |