Skip to content

Commit c11b407

Browse files
authored
Merge pull request #13 from jean-bonilha/dev
Optional parameter to response data key on ApiForm load method
2 parents 7793550 + f1afe6b commit c11b407

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mixins/ApiForm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ export default {
5555
this.create(saveCallback, errCallback);
5656
}
5757
},
58-
load(id, errCallback = (err) => {}) {
58+
load(id, errCallback = (err) => {}, dataKey) {
5959
if (id) {
6060
this.$api.get(`${this.route}/${id}/`).then((response) => {
61-
this.requestObj = response.data;
61+
this.requestObj = response[dataKey] || response.data;
6262
}).catch((err) => {
6363
errCallback(err);
6464
});

0 commit comments

Comments
 (0)