We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e7fdc2 commit 3715784Copy full SHA for 3715784
src/Resource.js
@@ -74,8 +74,14 @@ class Resource {
74
return this.api.get(url).then(extractData).catch(extractErrorResponse);
75
}
76
77
- create(partialRecord) {
78
- const record = Object.assign({}, partialRecord, {type: this.name});
+ create({attributes, relationships}) {
+ const record = {type: this.name};
79
+ if (attributes) {
80
+ record.attributes = attributes;
81
+ }
82
+ if (relationships) {
83
+ record.relationships = relationships;
84
85
const requestData = {data: record};
86
return this.api
87
.post(`${this.name}`, requestData)
0 commit comments