Skip to content

Commit

Permalink
Feature Added: type IResourceSchemaKeysDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
keenondrums committed Jul 20, 2018
1 parent 09450c9 commit 282dfdb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- [IAxiosResourceInterceptor](#iaxiosresourceinterceptor)
- [IBuildParamsExtendedRes](#ibuildparamsextendedres)
- [ICreateAxiosInstanceFromUrl](#icreateaxiosinstancefromurl)
- [IResourceSchemaKeysDefault](#iresourceschemakeysdefault)

### Variables

Expand Down Expand Up @@ -115,6 +116,15 @@

---

<a id="iresourceschemakeysdefault"></a>

### IResourceSchemaKeysDefault

**ΤIResourceSchemaKeysDefault**: _ "create" &#124; "read" &#124; "readOne" &#124; "remove" &#124; "update"
_

---

## Variables

<a id="axiosresourceadditionalprops"></a>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axios-rest-resource",
"version": "0.1.0",
"version": "0.1.1",
"description": "",
"main": "dist/index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ export interface IAPIMethodSchema {
url?: string
}

export type IResourceSchemaKeysDefault = 'create' | 'read' | 'readOne' | 'remove' | 'update'

/**
* @description
* Default resource schema used by ResourceBuilder.prototype.build
*/
export const resourceSchemaDefault = {
export const resourceSchemaDefault: { [ Key in IResourceSchemaKeysDefault ]: IAPIMethodSchema } = {
create: {
method: 'post'
},
Expand Down

0 comments on commit 282dfdb

Please sign in to comment.