Skip to content

Commit d4b884d

Browse files
authored
Allow to send empty relation lists (#101)
* Allow to send empty relation lists * Fix tests
1 parent ba73d70 commit d4b884d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
"eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
5151
"build": "babel src -d lib --ignore '*.test.js'",
5252
"watch": "babel --watch src -d lib --ignore '*.test.js'",
53-
"test-gen": "rm -rf ./tmp && npm run build && ./lib/index.js https://demo.api-platform.com ./tmp/react && ./lib/index.js https://demo.api-platform.com ./tmp/react-native -g react-native && ./lib/index.js https://demo.api-platform.com ./tmp/vue -g vue && ./lib/index.js https://demo.api-platform.com ./tmp/admin-on-rest -g admin-on-rest",
53+
"test-gen": "rm -rf ./tmp && yarn build && ./lib/index.js https://demo.api-platform.com ./tmp/react && ./lib/index.js https://demo.api-platform.com ./tmp/react-native -g react-native && ./lib/index.js https://demo.api-platform.com ./tmp/vue -g vue && ./lib/index.js https://demo.api-platform.com ./tmp/admin-on-rest -g admin-on-rest",
5454
"test-gen-cs": "./node_modules/.bin/prettier --single-quote -l \"./tmp/react/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
55-
"test-gen-swagger": "rm -rf ./tmp && npm run build && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react-native -g react-native -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/vue -g vue -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/admin-on-rest -g admin-on-rest -f swagger",
56-
"test-gen-env": "rm -rf ./tmp && npm run build && API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT=https://demo.api-platform.com API_PLATFORM_CLIENT_GENERATOR_OUTPUT=./tmp ./lib/index.js"
55+
"test-gen-swagger": "rm -rf ./tmp && yarn build && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react-native -g react-native -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/vue -g vue -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/admin-on-rest -g admin-on-rest -f swagger",
56+
"test-gen-env": "rm -rf ./tmp && yarn build && API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT=https://demo.api-platform.com API_PLATFORM_CLIENT_GENERATOR_OUTPUT=./tmp ./lib/index.js"
5757
},
5858
"bin": {
5959
"generate-api-platform-client": "./lib/index.js"

templates/react/components/foo/Form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Form extends Component {
5353
step="{{{step}}}"{{/if}}
5454
placeholder="{{{description}}}"{{#if required}}
5555
required={true}{{/if}}{{#if reference}}{{#unless maxCardinality}}
56-
normalize={v => v.split(',')}{{/unless}}{{/if}}
56+
normalize={v => (v === '' ? [] : v.split(','))}{{/unless}}{{/if}}
5757
/>
5858
{{/each}}
5959

0 commit comments

Comments
 (0)