UNPKG

tipi-services

Version:

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

37 lines (27 loc) 1.06 kB
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class ReservationsService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async details (ownerId, id) { return this.sendRequest({ endpoint: this.endpoints.details, params: { ownerId, id } }) } async checkIn (ownerId, id) { return this.sendRequest({ endpoint: this.endpoints.checkIn, params: { ownerId, id } }) } async pull (ownerId, data) { return this.sendRequest({ endpoint: this.endpoints.pull, params: { ownerId }, body: data }) } async batchDetails (data) { return this.sendRequest({ endpoint: this.endpoints.batchDetails, body: data }) } async getCheckInStatus (data) { return this.sendRequest({ endpoint: this.endpoints.getCheckInStatus, body: data}) } async batchGetCheckInStatus (data) { return this.sendRequest({ endpoint: this.endpoints.batchGetCheckInStatus, body: data }) } } module.exports = ReservationsService