joyent-portal/packages/cloudapi-gql/src/api/vlans.js
Sérgio Ramos ed4ce42237 feat(gql-cloudapi): template tag schema re-write
- uniform api usage for some models (account/user, networks/vlans/fabrics, etc)
 - graphidoc, playground, faker, and voyager support
 - schema in a template tag and documented
 - apollo-errors
 - apollo-server-hapi and schema using graphql-tools/makeExecutableSchema
 - replace express with Hapi
 - eslint support for graphql
 - updated dependencies
2017-10-03 14:59:22 +01:00

22 lines
575 B
JavaScript

const { fetch } = require('./request');
module.exports.list = () => fetch('/:login/fabrics/default/vlans');
module.exports.get = ({ id }) => fetch(`/:login/fabrics/default/vlans/${id}`);
module.exports.create = ctx =>
fetch(`/:login/fabrics/default/vlans`, {
method: 'POST',
body: ctx
});
module.exports.update = ({ id, ...rest }) =>
fetch(`/:login/fabrics/default/vlans/${id}`, {
method: 'PUT',
body: Object.assign({ id }, rest)
});
module.exports.destroy = ({ id }) =>
fetch(`/:login/fabrics/default/vlans/${id}`, {
method: 'DELETE'
});