Skip to content

Commit f596a47

Browse files
chore: merge beta
2 parents 3e99cdc + c27fa61 commit f596a47

File tree

9 files changed

+28
-12828
lines changed

9 files changed

+28
-12828
lines changed

example-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"typescript": "3.9.7"
2121
},
2222
"dependencies": {
23-
"admin-bro": "^3.0.0",
23+
"admin-bro": "^3.1.1",
2424
"@admin-bro/express": "^3.0.0",
2525
"@admin-bro/typeorm": "^1.0.1",
2626
"express": "^4.17.1",

example-app/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,10 +1350,10 @@ accepts@~1.3.7:
13501350
mime-types "~2.1.24"
13511351
negotiator "0.6.2"
13521352

1353-
admin-bro@^3.0.0:
1354-
version "3.0.0"
1355-
resolved "https://registry.yarnpkg.com/admin-bro/-/admin-bro-3.0.0.tgz#e6f6238672ab7ec46debd008eab6e6a1299fe59b"
1356-
integrity sha512-fXnPn/BFBSrib1oAn65kG6LhxE6WAH9QVsLjGw+gMut6j4l9uNloodrgxuERHMksMMDmO5pMzmCOUuqw3LmRuw==
1353+
admin-bro@^3.1.0-beta.3:
1354+
version "3.1.0-beta.3"
1355+
resolved "https://registry.yarnpkg.com/admin-bro/-/admin-bro-3.1.0-beta.3.tgz#d0677edec228dcb251e74758f22dc71aed685784"
1356+
integrity sha512-Dxccv+07bmUSWlyA5TtXoX/jqCaJE65GESBFBfbJHEbr/28CukK//lRAqPBhyNQWQAtsP8sot7kcelrDZ5Jm4w==
13571357
dependencies:
13581358
"@admin-bro/design-system" "^1.3.3"
13591359
"@babel/core" "^7.10.2"

package-lock.json

Lines changed: 0 additions & 12804 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"test": "mocha -r ts-node/register ./spec/**/*.spec.ts",
1919
"ts-node": "ts-node",
2020
"lint": "eslint './src/**/*.{ts,js}' './spec/**/*.{ts,js}' './example-app/**/*.{ts,js}' --ignore-pattern 'build' --ignore-pattern 'yarn.lock'",
21+
"check:all": "yarn lint && yarn test && yarn build",
2122
"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js",
2223
"release": "semantic-release"
2324
},
@@ -33,15 +34,15 @@
3334
"author": "Artem Zabolotnyi <[email protected]>",
3435
"license": "MIT",
3536
"peerDependencies": {
36-
"admin-bro": ">=3.0.0",
37+
"admin-bro": "^3.1.1",
3738
"typeorm": ">=0.2.1"
3839
},
3940
"optionalDependencies": {},
4041
"devDependencies": {
4142
"@types/chai": "^4.2.4",
4243
"@types/mocha": "^5.2.7",
4344
"@types/node": "12.0.10",
44-
"admin-bro": ">=3.0.0",
45+
"admin-bro": "^3.1.1",
4546
"chai": "^4.2.0",
4647
"class-validator": "^0.11.0",
4748
"mocha": "^6.2.2",

spec/entities/Car.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ export class Car extends BaseEntity {
4444
})
4545
public carType: CarType;
4646

47-
@ManyToOne((type) => CarDealer, (carDealer) => carDealer.cars)
47+
@ManyToOne(() => CarDealer, (carDealer) => carDealer.cars)
4848
public carDealer: CarDealer;
4949

5050
@RelationId((car: Car) => car.carDealer)
5151
public carDealerId: number;
5252

53-
@ManyToOne((type) => CarBuyer, (carBuyer) => carBuyer.cars)
53+
@ManyToOne(() => CarBuyer, (carBuyer) => carBuyer.cars)
5454
public carBuyer: CarBuyer;
5555

5656
@RelationId((car: Car) => car.carBuyer)

spec/entities/CarBuyer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export class CarBuyer extends BaseEntity {
1111
@IsDefined()
1212
public name: string;
1313

14-
@OneToMany((type) => Car, (car) => car.carDealer)
14+
@OneToMany(() => Car, (car) => car.carDealer)
1515
public cars: Array<Car>;
1616
}

spec/entities/CarDealer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export class CarDealer extends BaseEntity {
1111
@IsDefined()
1212
public name: string;
1313

14-
@OneToMany((type) => Car, (car) => car.carDealer)
14+
@OneToMany(() => Car, (car) => car.carDealer)
1515
public cars: Array<Car>;
1616
}

src/Resource.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class Resource extends BaseResource {
159159
const property = this.property(key)
160160

161161
// eslint-disable-next-line no-continue
162-
if (!(property && param)) continue
162+
if (!(property && param !== undefined)) continue
163163

164164
const type = property.type()
165165

@@ -172,14 +172,17 @@ export class Resource extends BaseResource {
172172
}
173173

174174
if (type === 'reference') {
175-
// references cannot be stored as an IDs in typeorm, so in order to mimic this) and
176-
// not fetching reference resource) change this:
177-
// { postId: "1" }
178-
// to that:
179-
// { post: { id: 1 } }
180-
181-
const id = (property.column.type === Number) ? Number(param) : param
182-
preparedParams[property.column.propertyName] = { id }
175+
if (param === null) {
176+
preparedParams[property.column.propertyName] = null
177+
} else {
178+
// references cannot be stored as an IDs in typeorm, so in order to mimic this) and
179+
// not fetching reference resource) change this:
180+
// { postId: "1" }
181+
// to that:
182+
// { post: { id: 1 } }
183+
const id = (property.column.type === Number) ? Number(param) : param
184+
preparedParams[property.column.propertyName] = { id }
185+
}
183186
}
184187
}
185188
return preparedParams

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,10 +1801,10 @@ acorn@^7.3.1:
18011801
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c"
18021802
integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==
18031803

1804-
admin-bro@>=3.0.0:
1805-
version "3.0.0"
1806-
resolved "https://registry.yarnpkg.com/admin-bro/-/admin-bro-3.0.0.tgz#e6f6238672ab7ec46debd008eab6e6a1299fe59b"
1807-
integrity sha512-fXnPn/BFBSrib1oAn65kG6LhxE6WAH9QVsLjGw+gMut6j4l9uNloodrgxuERHMksMMDmO5pMzmCOUuqw3LmRuw==
1804+
admin-bro@^3.1.1:
1805+
version "3.1.1"
1806+
resolved "https://registry.yarnpkg.com/admin-bro/-/admin-bro-3.1.1.tgz#b6c54a53f2c94ac1dfcaf6108663c56a0bf77926"
1807+
integrity sha512-i3k3E3oclXpNFKmia15y2vfqPQ7ddp1Z/JbQt40TVRHloPm+lG5WI/YJwA3Sx0zN2B42ClqngX0T07Cy+aumWQ==
18081808
dependencies:
18091809
"@admin-bro/design-system" "^1.3.3"
18101810
"@babel/core" "^7.10.2"

0 commit comments

Comments
 (0)