Skip to content

Commit

Permalink
fix(Position): meta optional in position patch
Browse files Browse the repository at this point in the history
  • Loading branch information
wmakeev committed Jul 26, 2021
1 parent 79dc2d7 commit 68ffe96
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moysklad-api-model",
"version": "0.3.6",
"version": "0.3.7",
"description": "Объектная модель API МойСклад для TypeScript проектов",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand All @@ -12,7 +12,7 @@
"compile": "tsc",
"build": "rm -rf build/ && npm run compile",
"git:tag": "git tag \"v$(cat package.json | json version)\"",
"npm:publish": "npm run build && npm publish && npm run git:tag"
"npm:publish": "npm run build && npm publish && npm run git:tag && git push"
},
"keywords": [
"moysklad",
Expand Down
6 changes: 4 additions & 2 deletions src/model/Position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ export interface Position<T extends PositionMetaType> extends Entity<T> {
>
}

export type PositionPatch<T extends PositionMetaType> = EntityPatchRef<T> &
Partial<Pick<Position<T>, 'quantity' | 'price' | 'discount' | 'assortment'>>
export type PositionPatch<T extends PositionMetaType> = Partial<
EntityPatchRef<T> &
Pick<Position<T>, 'quantity' | 'price' | 'discount' | 'assortment'>
>
4 changes: 1 addition & 3 deletions test/model/utils/Patch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ t1.positions = [
]

t1.positions = [
// @ts-expect-error
{
// У элемента коллекции должен быть обязательно указан meta
// meta?
// meta не бязательная для поля позиций в рамках документа
price: 12300,
discount: 10
}
Expand Down

0 comments on commit 68ffe96

Please sign in to comment.