Skip to content

Commit 9a8c77b

Browse files
committed
Change quick feedback url to /feedback instead of /graphql
1 parent 5aa5a99 commit 9a8c77b

1 file changed

Lines changed: 11 additions & 20 deletions

File tree

packages/components/src/components/common/QuickFeedbackRow.tsx

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,24 @@ export function QuickFeedbackRow(_props: QuickFeedbackRowProps) {
3838

3939
async function trySendFeedback() {
4040
const response = await axios.post(
41-
constants.GRAPHQL_ENDPOINT,
41+
`${constants.API_BASE_URL}/feedback`,
4242
{
43-
query: `
44-
mutation($input: SendFeedbackInput) {
45-
sendFeedback(input: $input)
46-
}`,
47-
variables: {
48-
input: {
49-
feedback: feedbackText || '',
50-
location:
51-
(currentOpenedModal && currentOpenedModal.name) ||
52-
(appToken ? 'MAIN_SCREEN' : 'LOGIN_SCREEN'),
53-
},
54-
},
43+
feedback: feedbackText || '',
44+
location:
45+
(currentOpenedModal && currentOpenedModal.name) ||
46+
(appToken ? 'MAIN_SCREEN' : 'LOGIN_SCREEN'),
5547
},
5648
{ headers: getDefaultDevHubHeaders({ appToken }) },
5749
)
5850

5951
if (!isMountedRef.current) return
6052

61-
const { data, errors } = await response.data
53+
const { data, status } = await response
6254

63-
if (errors && errors[0] && errors[0].message)
64-
throw new Error(errors[0].message)
65-
66-
if (!(data && data.sendFeedback)) {
67-
throw new Error('Failed to send feedback.')
55+
if (status !== 200) {
56+
throw new Error(
57+
typeof data === 'string' ? data : 'Failed to send feedback.',
58+
)
6859
}
6960
}
7061

@@ -151,7 +142,7 @@ export function QuickFeedbackRow(_props: QuickFeedbackRowProps) {
151142
color: 'foregroundColorMuted65',
152143
}}
153144
>
154-
join Slack
145+
Slack
155146
</Link>
156147
<ThemedText color="foregroundColorMuted65">
157148
{' to get a response.'}

0 commit comments

Comments
 (0)