Skip to content

Commit

Permalink
make ts build happy
Browse files Browse the repository at this point in the history
  • Loading branch information
after-ephemera committed Feb 2, 2024
1 parent 4e798d7 commit 6078601
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
18 changes: 7 additions & 11 deletions src/api/pd/pagerduty.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import querystring from "querystring";
import { type BotConfig } from "../../types";
import NodeCache from "node-cache";
import jsonConfig from "config";

const config: BotConfig = jsonConfig as BotConfig;

interface OncallsParams {
time_zone: string;
"include[]": string;
limit: number;
offset: number;
}

const oncallsParams: OncallsParams = {
const oncallsParams: Record<string, string | number> = {
time_zone: "UTC",
"include[]": "users",
offset: 0,
Expand All @@ -39,7 +31,7 @@ interface OncallOptions {
contentIndex: string;
secondaryIndex: string;
uri: string;
params: OncallsParams;
params: Record<string, string | number>;
}

/**
Expand Down Expand Up @@ -119,7 +111,11 @@ class PagerDuty {
this.endpoint +
options.uri +
"?" +
querystring.stringify(options.params);
new URLSearchParams({
...options.params,
offset: options.params.offset.toString(),
limit: options.params.limit.toString(),
}).toString();
requestOptions.url = url;

const response = await fetch(url, requestOptions);
Expand Down
5 changes: 2 additions & 3 deletions src/listeners/messages/oncall-mentioned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import { getOncallSlackMembers } from "@api/oncall";
import { oncallMap } from "@api/pd";
import { type OncallSlackUser } from "@srcapi/slack";

const oncallMentionedCallback: AllMiddlewareArgs &
SlackEventMiddlewareArgs<"message"> = async ({
const oncallMentionedCallback = async ({
context,
event,
say,
}: AllMiddlewareArgs & SlackEventMiddlewareArgs<"message">) => {
}: AllMiddlewareArgs & SlackEventMiddlewareArgs<"message">): Promise<void> => {
console.log("**** oncall mentioned");
const oncallTagged = context.matches[1];
const oncalls = await getOncallSlackMembers();
Expand Down

0 comments on commit 6078601

Please sign in to comment.