Skip to content

Commit bedc805

Browse files
committed
fix author notice in bug reports
1 parent f2d8811 commit bedc805

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/routes/api/create-issue.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export const post: RequestHandler = async ({ rawBody }) => {
1919
},
2020
}
2121
}
22+
23+
let authorNotice = ''
24+
if (fullName || email) authorNotice += ' by'
25+
if (fullName) authorNotice += ` ${fullName}`
26+
if (email) authorNotice += ` ${email}`
2227
const response = await fetch('https://api.github.com/repos/Nick-Mazuk/jw-lua-scripts/issues', {
2328
method: 'POST',
2429
headers: {
@@ -30,9 +35,7 @@ export const post: RequestHandler = async ({ rawBody }) => {
3035
body: JSON.stringify({
3136
title: `Bug report`,
3237
labels: ['bug'],
33-
body: `**Description**\n\n${description}\n\n**Metadata**\n\n- ${finale}\n- ${os}\n- Script: ${script}\n\n_Created through the website${
34-
fullName || email ? `by ${fullName} ${email}` : ''
35-
}_`,
38+
body: `**Description**\n\n${description}\n\n**Metadata**\n\n- ${finale}\n- ${os}\n- Script: ${script}\n\n_Created through the website${authorNotice}_`,
3639
}),
3740
})
3841
const json = await response.json()

0 commit comments

Comments
 (0)