@ticketbuddy/sdk
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "@ticketbuddy/sdk", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
const fetch = require("isomorphic-fetch"); | ||
async function post(endpoint, path, body = {}) { | ||
async function post({ endpoint, path, token }, body = {}) { | ||
return await format_response( | ||
@@ -9,3 +9,4 @@ await fetch(endpoint + path, { | ||
headers: { | ||
"content-type": "application/json" | ||
"content-type": "application/json", | ||
token: opts.token | ||
} | ||
@@ -12,0 +13,0 @@ }) |
const client = require("./client"); | ||
exports.create = async function() { | ||
return await client.post(client.TICKETBUDDY_BACKEND, "/company", {}); | ||
exports.create = async function({ token }) { | ||
return await client.post( | ||
{ | ||
token, | ||
path: "/company", | ||
endpoint: client.TICKETBUDDY_BACKEND | ||
}, | ||
{} | ||
); | ||
}; |
1197
5
33