File tree Expand file tree Collapse file tree 5 files changed +9
-16
lines changed
CreateTemplatesGalleryPage Expand file tree Collapse file tree 5 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -1659,11 +1659,9 @@ class ApiMethods {
1659
1659
return response . data ;
1660
1660
} ;
1661
1661
1662
- getTemplateExamples = async (
1663
- organizationId : string ,
1664
- ) : Promise < TypesGen . TemplateExample [ ] > => {
1662
+ getTemplateExamples = async ( ) : Promise < TypesGen . TemplateExample [ ] > => {
1665
1663
const response = await this . axios . get (
1666
- `/api/v2/organizations/${ organizationId } /templates/examples` ,
1664
+ `/api/v2/organizations/00000000-0000-0000-0000-000000000000 /templates/examples` ,
1667
1665
) ;
1668
1666
1669
1667
return response . data ;
Original file line number Diff line number Diff line change @@ -101,13 +101,10 @@ export const setGroupRole = (
101
101
} ;
102
102
} ;
103
103
104
- export const templateExamples = ( organizationId : string ) => {
104
+ export const templateExamples = ( ) => {
105
105
return {
106
- queryKey : [
107
- ...getTemplatesByOrganizationIdQueryKey ( organizationId ) ,
108
- "examples" ,
109
- ] ,
110
- queryFn : ( ) => API . getTemplateExamples ( organizationId ) ,
106
+ queryKey : [ "templates" , "examples" ] ,
107
+ queryFn : ( ) => API . getTemplateExamples ( ) ,
111
108
} ;
112
109
} ;
113
110
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ import { CreateTemplatesPageView } from "./CreateTemplatesPageView";
10
10
import { StarterTemplatesPageView } from "./StarterTemplatesPageView" ;
11
11
12
12
const CreateTemplatesGalleryPage : FC = ( ) => {
13
- const { organizationId , experiments } = useDashboard ( ) ;
14
- const templateExamplesQuery = useQuery ( templateExamples ( organizationId ) ) ;
13
+ const { experiments } = useDashboard ( ) ;
14
+ const templateExamplesQuery = useQuery ( templateExamples ( ) ) ;
15
15
const starterTemplatesByTag = templateExamplesQuery . data
16
16
? // Currently, the scratch template should not be displayed on the starter templates page.
17
17
getTemplatesByTag ( removeScratchExample ( templateExamplesQuery . data ) )
Original file line number Diff line number Diff line change @@ -3,14 +3,12 @@ import { Helmet } from "react-helmet-async";
3
3
import { useQuery } from "react-query" ;
4
4
import { useParams } from "react-router-dom" ;
5
5
import { templateExamples } from "api/queries/templates" ;
6
- import { useDashboard } from "modules/dashboard/useDashboard" ;
7
6
import { pageTitle } from "utils/page" ;
8
7
import { StarterTemplatePageView } from "./StarterTemplatePageView" ;
9
8
10
9
const StarterTemplatePage : FC = ( ) => {
11
10
const { exampleId } = useParams ( ) as { exampleId : string } ;
12
- const { organizationId } = useDashboard ( ) ;
13
- const templateExamplesQuery = useQuery ( templateExamples ( organizationId ) ) ;
11
+ const templateExamplesQuery = useQuery ( templateExamples ( ) ) ;
14
12
const starterTemplate = templateExamplesQuery . data ?. find (
15
13
( example ) => example . id === exampleId ,
16
14
) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const TemplatesPage: FC = () => {
25
25
? getTemplatesByOrg ( templatesQuery . data )
26
26
: undefined ;
27
27
const examplesQuery = useQuery ( {
28
- ...templateExamples ( organizationId ) ,
28
+ ...templateExamples ( ) ,
29
29
enabled : permissions . createTemplates ,
30
30
} ) ;
31
31
const error =
You can’t perform that action at this time.
0 commit comments