Skip to content

Commit 987e8c4

Browse files
committed
Fix readme
1 parent bc6290d commit 987e8c4

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,17 @@ To define `customAction` and customize it by using ember-data flow, adapters and
9191
- `actionId` - id of the action which can be handled later on in adpaters and serializers
9292
- `options` - optional parameter which will overwrite the configuration options
9393

94-
If you want to customize your request in your adapter please, implement our adapter mixin, eg:
94+
If you want to customize your request in your adapter please, implement our adapter mixin:
9595
```js
9696
import JSONAPIAdapter from 'ember-data/adapters/json-api';
9797
import { AdapterMixin } from 'ember-custom-actions';
9898

9999
export default JSONAPIAdapter.extend(AdapterMixin);
100100
```
101101

102-
You can customize following methods in the adpater:
102+
Now you can customize following methods in the adpater:
103103
* [urlForCustomAction](#urlForCustomAction)
104+
* [dataForCustomAction](#dataForCustomAction)
104105
* [methodForCustomAction](#methodForCustomAction)
105106
* [headersForCustomAction](#headersForCustomAction)
106107

@@ -111,10 +112,10 @@ You can define your custom path for every `customAction` by adding a conditional
111112
```js
112113
export default JSONAPIAdapter.extend(AdapterMixin, {
113114
urlForCustomAction(modelName, id, snapshot, actionId, queryParams) {
114-
if (requestType === 'myPublishAction') {
115+
if (actionId === 'myPublishAction') {
115116
return 'https://my-custom-api.com/publish'
116117
}
117-
118+
118119
return this._super(...arguments);
119120
}
120121
});
@@ -130,7 +131,7 @@ export default JSONAPIAdapter.extend(AdapterMixin, {
130131
if (requestType === 'myPublishAction') {
131132
return `${this._buildURL(modelName, id)}/publish`;
132133
}
133-
134+
134135
return this._super(...arguments);
135136
}
136137
});
@@ -147,7 +148,7 @@ export default JSONAPIAdapter.extend(AdapterMixin, {
147148
if (params.actionId === 'myPublishAction') {
148149
return 'PUT';
149150
}
150-
151+
151152
return this._super(...arguments);
152153
}
153154
});
@@ -166,14 +167,14 @@ export default JSONAPIAdapter.extend(AdapterMixin, {
166167
'Authorization-For-Custom-Action': 'mySuperToken123'
167168
};
168169
}
169-
170+
170171
return this._super(...arguments);
171172
}
172173
});
173174
```
174175

175176
#### dataForCustomAction
176-
You can define your custom headers for every `customAction` by adding a conditional:
177+
You can define your custom data for every `customAction` by adding a conditional:
177178

178179
```js
179180
import { AdapterMixin } from 'ember-custom-actions';
@@ -185,7 +186,7 @@ export default JSONAPIAdapter.extend(AdapterMixin, {
185186
myParam: 'send it to the server'
186187
};
187188
}
188-
189+
189190
return this._super(...arguments);
190191
}
191192
});

0 commit comments

Comments
 (0)