Merge branch 'data-transfer/transfer-tokens' of github.com:strapi/strapi into data-transfer/transfer-tokens

This commit is contained in:
Convly 2023-02-06 10:16:36 +01:00
commit 635c8a708d

View File

@ -38,9 +38,9 @@ module.exports = {
const { token: tokenService } = getService('transfer');
/**
* We trim both field to avoid having issues with either:
* - having a space at the end or start of the value.
* - having only spaces as value;
* We trim fields to avoid having issues with either:
* - having a space at the end or start of the value
* - having only spaces as value (so that an empty field can be caught in validation)
*/
const attributes = {
name: trim(body.name),
@ -68,9 +68,9 @@ module.exports = {
const attributes = body;
/**
* We trim both field to avoid having issues with either:
* - having a space at the end or start of the value.
* - having only spaces as value;
* We trim fields to avoid having issues with either:
* - having a space at the end or start of the value
* - having only spaces as value (so that an empty field can be caught in validation)
*/
if (has('name', attributes)) {
attributes.name = trim(body.name);