salix/front/core/mocks/crud-model.js

60 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2020-01-02 13:44:51 +00:00
const crudModel = {
_data: [1, 2, 3],
data: [],
filter: {},
order: {},
insert: () => {
return {
then: callback => {
callback({data: {id: 1234}});
}
};
},
remove: () => {
return {
then: callback => {
callback({data: {id: 1234}});
}
};
},
save: () => {
return {
then: callback => {
callback({data: {id: 1234}});
}
};
},
2019-04-30 07:19:40 +00:00
on: () => {
return {
then: callback => {
callback({data: {id: 1234}});
}
};
},
2020-01-02 13:44:51 +00:00
refresh: () => {
return {
then: callback => {
return callback({data: {id: 1234}});
}
};
},
addFilter: () => {
return {
then: callback => {
return callback({data: {id: 1234}});
}
};
},
applyFilter: () => {
crudModel.data = crudModel._data;
return {
then: callback => {
return callback({data: {id: 1234}});
}
};
},
};
2020-01-02 13:44:51 +00:00
module.exports = crudModel;