Doodle3D-API/src/api/config.js

20 lines
322 B
JavaScript
Raw Normal View History

import * as rest from './restapi.js';
2015-07-15 15:06:18 +02:00
export default class {
constructor (api) {
this.api = api;
2015-07-15 15:06:18 +02:00
}
get (...keys) {
2016-04-21 15:09:49 +02:00
return rest.get(`${ this.api }config/?${ keys.join('=&') }=`);
2015-07-15 15:06:18 +02:00
}
getAll () {
2016-04-21 15:09:49 +02:00
return rest.get(`${ this.api }config/all`);
2015-07-15 15:06:18 +02:00
}
set (data) {
2016-04-21 15:09:49 +02:00
return rest.post(`${ this.api }config`, data);
2015-07-15 15:06:18 +02:00
}
}