Initial commit

This commit is contained in:
2023-08-21 00:15:16 +00:00
commit 6a880d814f
31 changed files with 1519 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
'use strict'
class ConvertEmptyStringsToNull {
async handle ({ request }, next) {
if (Object.keys(request.body).length) {
request.body = Object.assign(
...Object.keys(request.body).map(key => ({
[key]: request.body[key] !== '' ? request.body[key] : null
}))
)
}
await next()
}
}
module.exports = ConvertEmptyStringsToNull