Files
mixtape/zero.Web.UI/App/resources/applications.js
T

42 lines
944 B
JavaScript
Raw Normal View History

2020-04-06 00:26:31 +02:00
import Axios from 'axios';
const base = 'applications/';
2020-04-06 00:26:31 +02:00
export default {
// get application by id
getById(id)
2020-04-06 00:26:31 +02:00
{
return Axios.get(base + 'getById', { params: { id } }).then(res => Promise.resolve(res.data));
},
// get new application model
getEmpty()
{
return Axios.get(base + 'getEmpty').then(res => Promise.resolve(res.data));
},
// get all applications
getAll(query)
{
return Axios.get(base + 'getAll', { params: query }).then(res => Promise.resolve(res.data));
},
// get all application features
getAllFeatures()
{
return Axios.get(base + 'getAllFeatures').then(res => Promise.resolve(res.data));
},
// save an application
save(model)
{
return Axios.post(base + 'save', model).then(res => Promise.resolve(res.data));
},
// deletes an application
delete(id)
{
return Axios.delete(base + 'delete', { params: { id } }).then(res => Promise.resolve(res.data));
2020-04-06 00:26:31 +02:00
}
};