Skip to content

Commit b15c891

Browse files
authored
Merge pull request #583 from HarperDB/fix-dedicated-references
Fix dedicated references
2 parents cf254bd + a1c615b commit b15c891

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/features/cluster/queries/getPlanTypesQuery.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ import { apiClient } from '@/config/apiClient';
22
import { queryKeys } from '@/react-query/constants';
33
import { queryOptions } from '@tanstack/react-query';
44

5-
const getPlanTypes = async () => {
6-
const { data } = await apiClient.get(`/Plan/`);
5+
async function getPlanTypes(organizationId: string) {
6+
const { data } = await apiClient.get(`/Plan/`, {
7+
params: {
8+
organizationId,
9+
},
10+
});
711
return data;
8-
};
12+
}
913

10-
function getPlanTypesOptions() {
14+
export function getPlanTypesOptions(organizationId: string) {
1115
return queryOptions({
12-
queryKey: [queryKeys.cluster, 'instancePlan'],
13-
queryFn: getPlanTypes,
16+
queryKey: [queryKeys.organization, organizationId, 'instancePlan'],
17+
queryFn: () => getPlanTypes(organizationId),
1418
retry: false,
1519
});
1620
}
17-
18-
export { getPlanTypesOptions };

src/features/clusters/upsert/ClusterForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ export function ClusterForm({
134134

135135
useEffect(() => {
136136
setLimitRegionParameters({
137-
availableHosts: selectedDeployment !== 'Dedicated for Cluster' ? true : undefined,
138-
organizationId: selectedDeployment === 'Dedicated for Organization' ? organizationId : undefined,
137+
availableHosts: selectedDeployment !== 'Dedicated' ? true : undefined,
138+
organizationId,
139139
});
140140
}, [organizationId, selectedDeployment, setLimitRegionParameters]);
141141

src/features/clusters/upsert/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function UpsertCluster() {
3030

3131
const { data: cluster } = useQuery(getClusterInfoQueryOptions(clusterId));
3232
const { data: organization } = useQuery(getOrganizationQueryOptions(organizationId));
33-
const { data: planTypes } = useQuery(getPlanTypesOptions());
33+
const { data: planTypes } = useQuery(getPlanTypesOptions(organizationId));
3434
const { data: regionLocations } = useQuery(getRegionLocationsOptions(limitRegionParameters));
3535

3636
const deploymentToPerformanceToPlan = useMemo<Record<string, Record<string, SchemaPlan>>>(() =>

0 commit comments

Comments
 (0)