Skip to content

Commit

Permalink
fix: only use discussion for feed error
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Nov 22, 2024
1 parent 8a9cac6 commit e30783b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions apps/renderer/src/lib/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@ interface IssueOptions {
body: string
label: string
error?: Error
target: "issue" | "discussion"
category: string
}

export const getNewIssueUrl = ({ body, label, title, error }: Partial<IssueOptions> = {}) => {
const baseUrl = `${repository.url}/discussions/new`
export const getNewIssueUrl = ({
body,
label,
title,
error,
target = "issue",
category,
}: Partial<IssueOptions> = {}) => {
const baseUrl =
target === "discussion" ? `${repository.url}/discussions/new` : `${repository.url}/issues/new`

const searchParams = new URLSearchParams()
searchParams.set("category", "feed-expired")
if (category) searchParams.set("category", category)

let nextBody = [body || "", "", ...getCurrentEnvironment()].join("\n")
if (label) searchParams.set("label", label)
Expand Down
2 changes: 2 additions & 0 deletions apps/renderer/src/modules/discover/feed-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ export const FeedForm: Component<{
"```",
].join("\n"),
title: `Error in fetching feed: ${id ?? url}`,
target: "discussion",
category: "feed-expired",
}),
"_blank",
)
Expand Down

0 comments on commit e30783b

Please sign in to comment.