Skip to content

Commit

Permalink
fix: update github id types from number to bigint in typescript (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockingrohit9639 authored Mar 9, 2024
1 parent 39e2be2 commit 2104633
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pages/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default (_, res: NextApiResponse) => {
*/
export const upsertUser = async (
linearClient: LinearClient,
githubUserId: number,
githubUserId: bigint,
linearUserId: string,
userAgentHeader: string,
githubAuthHeader: string
Expand Down Expand Up @@ -217,7 +217,7 @@ export const applyLabel = async ({
userAgentHeader
}: {
repoFullName: string;
issueNumber: number;
issueNumber: bigint;
labelNames: string[];
githubAuthHeader: string;
userAgentHeader: string;
Expand Down Expand Up @@ -252,7 +252,7 @@ export const createComment = async ({
userAgentHeader
}: {
repoFullName: string;
issueNumber: number;
issueNumber: bigint;
body: string;
githubAuthHeader: string;
userAgentHeader: string;
Expand Down
2 changes: 1 addition & 1 deletion utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { formatJSON } from ".";
export const getIssueUpdateError = (
resource: "state" | "description" | "title" | "assignee",
data: { number: number; id: string; team: { key: string } },
syncedIssue: { githubIssueNumber: number; githubIssueId: number },
syncedIssue: { githubIssueNumber: bigint; githubIssueId: bigint },
updatedIssueResponse: any
): string => {
return `Failed to update GitHub issue ${resource} for ${data.team.key}-${
Expand Down
2 changes: 1 addition & 1 deletion utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export const updateMilestone = async (
export const setIssueMilestone = async (
token: string,
repoName: string,
issueNumber: number,
issueNumber: bigint,
milestoneId: number | null
): Promise<Response> => {
const response = await fetch(
Expand Down
6 changes: 3 additions & 3 deletions utils/webhook/linear.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export async function linearWebhookHandler(

const { error: applyLabelError } = await applyLabel({
repoFullName,
issueNumber: createdIssueData.number,
issueNumber: BigInt(createdIssueData.number),
labelNames,
githubAuthHeader,
userAgentHeader
Expand Down Expand Up @@ -432,7 +432,7 @@ export async function linearWebhookHandler(

const { error: commentError } = await createComment({
repoFullName,
issueNumber: createdIssueData.number,
issueNumber: BigInt(createdIssueData.number),
body: `${modifiedComment || ""}${footer}`,
githubAuthHeader,
userAgentHeader
Expand Down Expand Up @@ -1119,7 +1119,7 @@ export async function linearWebhookHandler(

const { error: applyLabelError } = await applyLabel({
repoFullName,
issueNumber: createdIssueData.number,
issueNumber: BigInt(createdIssueData.number),
labelNames,
githubAuthHeader,
userAgentHeader
Expand Down

0 comments on commit 2104633

Please sign in to comment.