11import { Fragment } from 'react' ;
22import styled from '@emotion/styled' ;
3+ import { useQuery } from '@tanstack/react-query' ;
34
45import { EventUserFeedback } from 'sentry/components/events/userFeedback' ;
56import * as Layout from 'sentry/components/layouts/thirds' ;
67import { LoadingError } from 'sentry/components/loadingError' ;
78import { LoadingIndicator } from 'sentry/components/loadingIndicator' ;
89import { Pagination } from 'sentry/components/pagination' ;
910import { t } from 'sentry/locale' ;
11+ import { selectJsonWithHeaders } from 'sentry/utils/api/apiOptions' ;
1012import { useLocation } from 'sentry/utils/useLocation' ;
1113import { useOrganization } from 'sentry/utils/useOrganization' ;
1214import { useParams } from 'sentry/utils/useParams' ;
1315import { FeedbackEmptyState } from 'sentry/views/feedback/feedbackEmptyState' ;
16+ import { groupUserFeedbackApiOptions } from 'sentry/views/issueDetails/groupUserFeedbackApiOptions' ;
1417import { useGroup } from 'sentry/views/issueDetails/useGroup' ;
15- import { useGroupUserFeedback } from 'sentry/views/issueDetails/useGroupUserFeedback' ;
1618
1719function GroupUserFeedback ( ) {
1820 const organization = useOrganization ( ) ;
@@ -28,17 +30,14 @@ function GroupUserFeedback() {
2830 groupId : params . groupId ,
2931 } ) ;
3032
31- const {
32- data : reportList ,
33- isPending,
34- isError,
35- refetch,
36- getResponseHeader,
37- } = useGroupUserFeedback ( {
38- groupId : params . groupId ,
39- query : {
40- cursor : location . query . cursor as string | undefined ,
41- } ,
33+ const { data, isPending, isError, refetch} = useQuery ( {
34+ ...groupUserFeedbackApiOptions ( organization , {
35+ groupId : params . groupId ,
36+ query : {
37+ cursor : location . query . cursor ,
38+ } ,
39+ } ) ,
40+ select : selectJsonWithHeaders ,
4241 } ) ;
4342
4443 if ( isError || isErrorGroup ) {
@@ -62,7 +61,8 @@ function GroupUserFeedback() {
6261 ) ;
6362 }
6463
65- const pageLinks = getResponseHeader ?.( 'Link' ) ;
64+ const reportList = data ?. json ?? [ ] ;
65+ const pageLinks = data ?. headers . Link ;
6666 const hasUserFeedback = group . project . hasUserReports ;
6767
6868 return (
0 commit comments