Skip to content

Commit

Permalink
fix how API URL is built
Browse files Browse the repository at this point in the history
  • Loading branch information
mgwalker committed Nov 20, 2024
1 parent 41f453f commit b106312
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/tock.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const path = require("node:path");
const { cache } = require("./cache");
const { getSlackUsers } = require("./slack");

const getFromTock = async (url) =>
cache(`tock fetch: ${url}`, 10, async () => {
const absoluteURL = new URL(url, process.env.TOCK_API);
const absoluteURL = new URL(process.env.TOCK_API);
absoluteURL.pathname = path.join(absoluteURL.pathname, url);

return fetch(absoluteURL, {
headers: { Authorization: `Token ${process.env.TOCK_TOKEN}` },
}).then((r) => r.json());
Expand Down

0 comments on commit b106312

Please sign in to comment.