mirror of
https://github.com/flarum/core.git
synced 2025-07-27 03:30:28 +02:00
Move extractMeta override to serializer
This commit is contained in:
@@ -5,15 +5,6 @@ import config from '../config/environment';
|
|||||||
export default JsonApiAdapter.extend({
|
export default JsonApiAdapter.extend({
|
||||||
host: config.apiURL,
|
host: config.apiURL,
|
||||||
|
|
||||||
// We can get rid of this after
|
|
||||||
// https://github.com/kurko/ember-json-api/pull/59 is merged.
|
|
||||||
extractMeta: function(store, type, payload) {
|
|
||||||
if (payload && payload.meta) {
|
|
||||||
store.metaForType(type, payload.meta);
|
|
||||||
delete payload.meta;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
ajaxError: function(jqXHR) {
|
ajaxError: function(jqXHR) {
|
||||||
var errors = this._super(jqXHR);
|
var errors = this._super(jqXHR);
|
||||||
if (errors instanceof DS.InvalidError) {
|
if (errors instanceof DS.InvalidError) {
|
||||||
|
@@ -9,5 +9,14 @@ export default JsonApiSerializer.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return this._super(type, json, property);
|
return this._super(type, json, property);
|
||||||
|
},
|
||||||
|
|
||||||
|
// We can get rid of this after
|
||||||
|
// https://github.com/kurko/ember-json-api/pull/59 is merged.
|
||||||
|
extractMeta: function(store, type, payload) {
|
||||||
|
if (payload && payload.meta) {
|
||||||
|
store.setMetadataFor(type, payload.meta);
|
||||||
|
delete payload.meta;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
Reference in New Issue
Block a user