Skip to content

Commit

Permalink
Update issue.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
leelasn authored Oct 3, 2024
1 parent 0c5c39e commit 5cd28b3
Showing 1 changed file with 21 additions and 30 deletions.
51 changes: 21 additions & 30 deletions src/triggers/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ interface TeamIssuesResponse {
project?: {
id: string;
name: string;
};
}
projectMilestone?: {
id: string;
name: string;
};
}
creator: {
id: string;
name: string;
Expand All @@ -38,16 +38,16 @@ interface TeamIssuesResponse {
email: string;
};
status: {
id: string;
name: string;
type: string;
};
id: string,
name: string,
type: string
},
parent?: {
id: string;
identifier: string;
url: string;
title: string;
};
}
}[];
pageInfo: {
hasNextPage: boolean;
Expand All @@ -65,21 +65,18 @@ const buildIssueList = (orderBy: "createdAt" | "updatedAt") => async (z: ZObject

const cursor = bundle.meta.page ? await z.cursor.get() : undefined;

const variables = omitBy(
{
after: cursor,
teamId: bundle.inputData.team_id,
statusId: bundle.inputData.status_id,
creatorId: bundle.inputData.creator_id,
assigneeId: bundle.inputData.assignee_id,
priority: (bundle.inputData.priority && Number(bundle.inputData.priority)) || undefined,
labelId: bundle.inputData.label_id,
projectId: bundle.inputData.project_id,
projectMilestoneId: bundle.inputData.project_milestone_id,
orderBy,
},
(v) => v === undefined
);
const variables = omitBy({
after: cursor,
teamId: bundle.inputData.team_id,
statusId: bundle.inputData.status_id,
creatorId: bundle.inputData.creator_id,
assigneeId: bundle.inputData.assignee_id,
priority: bundle.inputData.priority && Number(bundle.inputData.priority) || undefined,
labelId: bundle.inputData.label_id,
projectId: bundle.inputData.project_id,
projectMilestoneId: bundle.inputData.project_milestone_id,
orderBy,
}, v => v === undefined);

const filters = [];
if ("priority" in variables) {
Expand Down Expand Up @@ -130,14 +127,10 @@ const buildIssueList = (orderBy: "createdAt" | "updatedAt") => async (z: ZObject
first: 10
after: $after
orderBy: $orderBy
${
filters.length > 0
? `
${filters.length > 0 ?`
filter: {
${filters.join("\n ")}
}`
: ""
}
}` : ""}
) {
nodes {
id
Expand Down Expand Up @@ -295,7 +288,6 @@ export const newIssue = {
display: {
label: "New Issue",
description: "Triggers when a new issue is created.",
hidden: true,
},
operation: {
...issue.operation,
Expand All @@ -310,7 +302,6 @@ export const updatedIssue = {
display: {
label: "Updated Issue",
description: "Triggers when an issue is updated.",
hidden: true,
},
operation: {
...issue.operation,
Expand Down

0 comments on commit 5cd28b3

Please sign in to comment.