UNPKG

oa-jira

Version:

Octet Agile's JIRA connectivity project.

16 lines (13 loc) 586 B
const jira = require('../../jira'); const Type = require('../classes/type.class'); exports.create = ({ id, description, iconUrl, name, subtask, hierarchyLevel } = {}) => { return Type.create({ id, description, iconUrl, name, subtask, hierarchyLevel }); }; exports.getById = ({ connection, id, cache }) => { if (cache.types.has(id)) return cache.types.get(id); return jira .getTypeById(connection, id) .then(data => (data ? Type.create(data) : Promise.resolve())) .then(type => cache.types.set(id, type)) .catch(error => Promise.reject(error)); };