UNPKG

tipi-services

Version:

Node.js library to access wrapping REST API of tipi backend services

25 lines (18 loc) 742 B
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class ReservationsService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async pull (ownerId, data) { return this.sendRequest({ endpoint: this.endpoints.pull, params: { ownerId }, body: data }) } async details (ownerId, id, calculateRoomReady = false) { return this.sendRequest({ endpoint: this.endpoints.details, params: { ownerId, id }, query: { calculateRoomReady } }) } async checkIn (ownerId, id, data) { return this.sendRequest({ endpoint: this.endpoints.checkIn, params: { ownerId, id }, body: data }) } } module.exports = ReservationsService