forked from rc/aircox
update assets dependencies; still work to be done to solve it all
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
function getCookie(name) {
|
||||
if(document.cookie && document.cookie !== '') {
|
||||
@ -82,7 +81,7 @@ export default class Model {
|
||||
*/
|
||||
commit(data) {
|
||||
this.id = this.constructor.getId(data);
|
||||
Vue.set(this, 'data', data);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -123,12 +122,12 @@ export class Set {
|
||||
/**
|
||||
* Fetch multiple items from server
|
||||
*/
|
||||
static fetch(url, options=null, args=null) {
|
||||
static fetch(model, url, options=null, args=null) {
|
||||
options = this.getOptions(options)
|
||||
return fetch(url, options)
|
||||
.then(response => response.json())
|
||||
.then(data => (data instanceof Array ? data : data.results)
|
||||
.map(d => new this.model(d, {url: url, ...args})))
|
||||
.map(d => new model(d, {url: url, ...args})))
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user