Skip to content

Commit

Permalink
feat: Define methods for fetch backend explicitly
Browse files Browse the repository at this point in the history
Signed-off-by: Jorgen Ader <[email protected]>
  • Loading branch information
jorgenader committed Nov 19, 2024
1 parent 2a1ec07 commit 1bf3093
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"test": "jest --bail",
"test:watch": "jest --watch --bail",
"test:coverage": "yarn test --coverage",
"check-packages": "yarn clean && yarn build && yarn test && yarn lint && yarn type-check",
"check-packages": "yarn clean && yarn build && yarn test && yarn lint && yarn check-types",
"bump-version": "lerna --ignore=examples/* version --no-push --exact",
"deploy": "lerna publish --conventional-commits --message 'chore: release new versions'",
"prerelease": "lerna publish --conventional-prerelease --pre-dist-tag next",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export type ResourceMethods = ResourceFetchMethods | ResourcePostMethods;

export type AllowedFetchMethods = 'get' | 'head' | 'options';

export type AllowedPostMethods = 'post' | 'patch' | 'put' | 'del';
export type AllowedPostMethods = 'post' | 'patch' | 'put' | 'del' | 'delete';

export type AllowedMethods = AllowedFetchMethods | AllowedPostMethods;

Expand Down
7 changes: 7 additions & 0 deletions packages/tg-resources-fetch/src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ function parseMethod(method: AllowedMethods) {
case 'put':
return 'PUT';

case 'patch':
return 'PATCH';

case 'post':
return 'POST';

case 'del':
case 'delete':
return 'DELETE';

default:
Expand Down

0 comments on commit 1bf3093

Please sign in to comment.