2016-02-10 21:36:40 -08:00
|
|
|
// InstallationsRouter.js
|
|
|
|
|
|
|
|
|
|
import ClassesRouter from './ClassesRouter';
|
|
|
|
|
import rest from '../rest';
|
|
|
|
|
|
|
|
|
|
export class InstallationsRouter extends ClassesRouter {
|
2017-09-05 17:51:11 -04:00
|
|
|
className() {
|
|
|
|
|
return '_Installation';
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-10 21:36:40 -08:00
|
|
|
handleFind(req) {
|
2016-12-07 15:17:05 -08:00
|
|
|
const body = Object.assign(req.body, ClassesRouter.JSONFromQuery(req.query));
|
2017-09-05 17:51:11 -04:00
|
|
|
const options = ClassesRouter.optionsFromBody(body);
|
2016-02-10 21:36:40 -08:00
|
|
|
return rest.find(req.config, req.auth,
|
2016-07-12 10:06:13 -04:00
|
|
|
'_Installation', body.where, options, req.info.clientSDK)
|
2016-02-10 21:36:40 -08:00
|
|
|
.then((response) => {
|
|
|
|
|
return {response: response};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-19 23:47:44 -05:00
|
|
|
mountRoutes() {
|
|
|
|
|
this.route('GET','/installations', req => { return this.handleFind(req); });
|
|
|
|
|
this.route('GET','/installations/:objectId', req => { return this.handleGet(req); });
|
|
|
|
|
this.route('POST','/installations', req => { return this.handleCreate(req); });
|
|
|
|
|
this.route('PUT','/installations/:objectId', req => { return this.handleUpdate(req); });
|
|
|
|
|
this.route('DELETE','/installations/:objectId', req => { return this.handleDelete(req); });
|
2016-02-10 21:36:40 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default InstallationsRouter;
|