Skip to content

Commit 0ef378c

Browse files
alechirschdanivek
authored andcommitted
Fix default schema (#85)
1 parent a32ba8d commit 0ef378c

File tree

3 files changed

+40
-2305
lines changed

3 files changed

+40
-2305
lines changed

Diff for: lib/JSONAPISerializer.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ module.exports = class JSONAPISerializer {
359359
* @param {Map<string, object>} included Included resources.
360360
* @returns {object} deserialized data.
361361
*/
362-
deserializeResource(type, data, schema, included) {
362+
deserializeResource(type, data, schema = 'default', included) {
363363
if (typeof type === 'object') {
364364
type = typeof type.type === 'function' ? type.type(data) : get(data, type.type);
365365
}
@@ -372,8 +372,6 @@ module.exports = class JSONAPISerializer {
372372
throw new Error(`No type registered for ${type}`);
373373
}
374374

375-
schema = 'default';
376-
377375
const options = this.schemas[type][schema];
378376

379377
let deserializedData = {};

0 commit comments

Comments
 (0)