UNPKG

tipi-services

Version:

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

26 lines (18 loc) 666 B
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class BoardsService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async create (data) { return this.sendRequest({ endpoint: this.endpoints.create, body: data }) } async getByOwner (ownerId, extend) { return this.sendRequest({ endpoint: this.endpoints.getByOwner, params: { ownerId }, query: { extend } }) } async getArchivedCards (ownerId) { return this.sendRequest({ endpoint: this.endpoints.getArchivedCards, params: { ownerId } }) } } module.exports = BoardsService