Skip to content

Commit f75decc

Browse files
committed
feat: Detect array of numbers
1 parent 1d8c38c commit f75decc

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
"author": "Artem Zabolotnyi <[email protected]>",
3636
"license": "MIT",
3737
"peerDependencies": {
38-
"admin-bro": "^3.3.1",
38+
"admin-bro": "^3.x",
3939
"typeorm": ">=0.2.28"
4040
},
4141
"optionalDependencies": {},
4242
"devDependencies": {
4343
"@types/chai": "^4.2.4",
4444
"@types/mocha": "^5.2.7",
4545
"@types/node": "12.0.10",
46-
"admin-bro": "^3.3.1",
46+
"admin-bro": "3.4.0-beta.2",
4747
"chai": "^4.2.0",
4848
"class-validator": "^0.11.0",
4949
"mocha": "^6.2.2",

src/Property.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,8 @@ export class Property extends BaseProperty {
6060

6161
return type
6262
}
63+
64+
public isArray(): boolean {
65+
return this.column.isArray
66+
}
6367
}

src/Resource.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ export class Resource extends BaseResource {
145145
}
146146

147147
if (type === 'number') {
148-
preparedParams[key] = Number(param)
148+
if (property.isArray()) {
149+
preparedParams[key] = param.map((p) => Number(p))
150+
} else {
151+
preparedParams[key] = Number(param)
152+
}
149153
}
150154

151155
if (type === 'reference') {

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# yarn lockfile v1
33

44

5-
"@admin-bro/design-system@^1.7.0":
5+
"@admin-bro/[email protected]":
66
version "1.7.0"
77
resolved "https://registry.yarnpkg.com/@admin-bro/design-system/-/design-system-1.7.0.tgz#1a5f46bff89db7aba33367db9a84cf00ddaaea5c"
88
integrity sha512-pf+b/YkKoylvcg1wp1yUhbWv0e5MZHjKQdPqTt6UXutVgpqldimDv5be3i2avkqNSB5XrOXVZTIcW4vj0vy33g==
@@ -1887,12 +1887,12 @@ acorn@^7.3.1:
18871887
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c"
18881888
integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==
18891889

1890-
admin-bro@^3.3.1:
1891-
version "3.3.1"
1892-
resolved "https://registry.yarnpkg.com/admin-bro/-/admin-bro-3.3.1.tgz#ef7710310f80b0c945fbb1dff49c6b2359c9a882"
1893-
integrity sha512-ObdiPDMA8u89U35fwRHxSaje2zBjPqkKlT+6oN80HIRdkQImQ+51hEU5YaQ/EEzWFQGqGYuSxAhkFtXY6ZLjhg==
1890+
admin-bro@3.4.0-beta.2:
1891+
version "3.4.0-beta.2"
1892+
resolved "https://registry.yarnpkg.com/admin-bro/-/admin-bro-3.4.0-beta.2.tgz#94f952c9bc992e586cd86e19374d26f701a61923"
1893+
integrity sha512-6xyRCREeHQunYAfHa+owpCFuxeWEckLwko0K5zY9FB/X7sVTWiMuH4/u99paQp3xoD9QMeviaFI1ajFipYE8nw==
18941894
dependencies:
1895-
"@admin-bro/design-system" "^1.7.0"
1895+
"@admin-bro/design-system" "1.7.0"
18961896
"@babel/core" "^7.10.2"
18971897
"@babel/parser" "^7.10.2"
18981898
"@babel/plugin-transform-runtime" "^7.10.1"

0 commit comments

Comments
 (0)