tipi-services
Version:
Node.js library to access wrapping REST API of tipi backend services
33 lines (24 loc) • 969 B
JavaScript
const Service = require('../../../Service')
const Endpoints = require('./Endpoints')
class RandomPinsService extends Service {
constructor (baseUrl) {
super()
this.endpoints = Endpoints(baseUrl)
}
async add (id, data) {
return this.sendRequest({ endpoint: this.endpoints.add, body: data, params: { id } })
}
async removeByIndex (id, index, data) {
return this.sendRequest({ endpoint: this.endpoints.removeByIndex, body: data, params: { id, index } })
}
async removeAll (id, data) {
return this.sendRequest({ endpoint: this.endpoints.removeAll, body: data, params: { id } })
}
async disable (id, index, data) {
return this.sendRequest({ endpoint: this.endpoints.disable, body: data, params: { id, index } })
}
async enable (id, index, data) {
return this.sendRequest({ endpoint: this.endpoints.enable, body: data, params: { id, index } })
}
}
module.exports = RandomPinsService