kia-ml
Version:
Kia
32 lines (26 loc) • 852 B
JavaScript
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import { getGeneralApiProblem } from './api-problem';
export class BookmarkApi {
constructor(api) {
_defineProperty(this, "api", void 0);
this.api = api;
}
async toggleBookmark(clientId, requestId) {
try {
const response = await this.api.apisauce.post(`api/bookmark/${clientId}/${requestId}`);
if (!response.ok) {
const problem = getGeneralApiProblem(response);
if (problem) return problem;
}
console.log(response);
return {
kind: "ok"
};
} catch (e) {
return {
kind: "bad-data"
};
}
}
}
//# sourceMappingURL=bookmark-api.js.map