salix/front/core/lib/crud.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-02-10 15:18:01 +00:00
import ngModule from '../module';
2017-02-21 10:36:43 +00:00
index.$inject = ['mgIndex'];
function index(mgIndex) {
2017-02-24 12:03:23 +00:00
return Object.assign({}, mgIndex, {
2017-09-28 12:34:18 +00:00
init: 'index.filter={page: 1, size: 5}'
2017-02-21 10:36:43 +00:00
});
}
2018-02-10 15:18:01 +00:00
ngModule.factory('vnIndex', index);
2017-02-21 10:36:43 +00:00
2017-11-21 10:12:52 +00:00
nonAuto.$inject = ['mgIndex'];
function nonAuto(mgIndex) {
return Object.assign({}, mgIndex, {
auto: false
});
}
2018-02-10 15:18:01 +00:00
ngModule.factory('vnIndexNonAuto', nonAuto);
2017-11-21 10:12:52 +00:00
2017-02-21 10:36:43 +00:00
successFactoryCreate.$inject = ['mgSuccessFactoryCreate'];
function successFactoryCreate(create) {
2017-02-24 12:03:23 +00:00
return Object.assign({}, create, {
2017-02-21 10:36:43 +00:00
back: undefined
});
}
2018-02-10 15:18:01 +00:00
ngModule.factory('vnSuccessFactoryCreate', successFactoryCreate);
2017-02-21 10:36:43 +00:00
put.$inject = ['mgPut'];
function put(mgPut) {
2017-02-24 12:03:23 +00:00
return Object.assign({}, mgPut, {
2017-02-21 10:36:43 +00:00
success: 'vnSuccessFactoryCreate'
});
}
2018-02-10 15:18:01 +00:00
ngModule.factory('vnPut', put);
2017-02-21 10:36:43 +00:00
patch.$inject = ['mgPatch'];
2017-06-03 11:01:47 +00:00
function patch(mgPatch) {
return Object.assign({}, mgPatch, {
success: 'vnSuccessFactoryCreate'
});
}
2018-02-10 15:18:01 +00:00
ngModule.factory('vnPatch', patch);
2017-06-03 11:01:47 +00:00
2017-02-21 10:36:43 +00:00
post.$inject = ['mgCreate'];
function post(mgCreate) {
2017-02-24 12:03:23 +00:00
return Object.assign({}, mgCreate, {
2017-02-21 15:21:55 +00:00
as: 'post',
2017-02-21 10:36:43 +00:00
success: 'vnSuccessFactoryCreate'
});
}
2018-02-10 15:18:01 +00:00
ngModule.factory('vnPost', post);