Skip to content

Commit b414118

Browse files
committed
undo unnecessary changes
1 parent bbbe8fa commit b414118

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

apps/dashboard/src/@3rdweb-sdk/react/cache-keys.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export const engineKeys = {
111111
] as const,
112112
health: (instance: string) =>
113113
[...engineKeys.all, instance, "health"] as const,
114-
deployment: () => [...engineKeys.all, "deployment"] as const,
114+
deploymentPublicConfiguration: () =>
115+
[...engineKeys.all, "deploymentPublicConfiguration"] as const,
115116
systemMetrics: (engineId: string) =>
116117
[...engineKeys.all, engineId, "systemMetrics"] as const,
117118
queueMetrics: (engineId: string) =>

apps/dashboard/src/@3rdweb-sdk/react/hooks/useEngine.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export function useEngineGetDeploymentPublicConfiguration(
206206
input: GetDeploymentPublicConfigurationInput,
207207
) {
208208
return useQuery<DeploymentPublicConfigurationResponse>({
209-
queryKey: engineKeys.deployment(),
209+
queryKey: engineKeys.deploymentPublicConfiguration(),
210210
queryFn: async () => {
211211
const res = await fetch(
212212
`${THIRDWEB_API_HOST}/v1/teams/${input.teamId}/engine/deployments/public-configuration`,
@@ -278,26 +278,24 @@ export function useEngineRemoveFromDashboard() {
278278
});
279279
}
280280

281-
export interface DeleteDeploymentInput {
282-
teamId: string;
281+
export interface DeleteCloudHostedInput {
283282
deploymentId: string;
284283
reason: "USING_SELF_HOSTED" | "TOO_EXPENSIVE" | "MISSING_FEATURES" | "OTHER";
285284
feedback: string;
286285
}
287286

288-
export function useEngineDeleteDeployment() {
287+
export function useEngineDeleteCloudHosted() {
289288
const { user } = useLoggedInUser();
290289
const queryClient = useQueryClient();
291290

292291
return useMutation({
293292
mutationFn: async ({
294-
teamId,
295293
deploymentId,
296294
reason,
297295
feedback,
298-
}: DeleteDeploymentInput) => {
296+
}: DeleteCloudHostedInput) => {
299297
const res = await fetch(
300-
`${THIRDWEB_API_HOST}/v1/teams/${teamId}/engine/deployments/${deploymentId}/delete`,
298+
`${THIRDWEB_API_HOST}/v2/engine/deployments/${deploymentId}/infrastructure/delete`,
301299
{
302300
method: "POST",
303301
headers: {

apps/dashboard/src/app/team/[team_slug]/(team)/~/engine/(general)/overview/engine-instances-table.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import { Input } from "@/components/ui/input";
1414
import { Textarea } from "@/components/ui/textarea";
1515
import { ToolTipLabel } from "@/components/ui/tooltip";
1616
import {
17-
type DeleteDeploymentInput,
17+
type DeleteCloudHostedInput,
1818
type EditEngineInstanceInput,
1919
type EngineInstance,
20-
useEngineDeleteDeployment,
20+
useEngineDeleteCloudHosted,
2121
useEngineEditInstance,
2222
type useEngineInstances,
2323
useEngineRemoveFromDashboard,
@@ -384,20 +384,17 @@ function DeleteSubscriptionModalContent(props: {
384384
"Instance must have a deploymentId to be cancelled.",
385385
);
386386

387-
const teamId = "DEBUG - UNIMPLEMENTED";
388-
389-
const deleteDeploymentMutation = useEngineDeleteDeployment();
387+
const deleteCloudHosted = useEngineDeleteCloudHosted();
390388
const [ackDeletion, setAckDeletion] = useState(false);
391-
const form = useForm<DeleteDeploymentInput>({
389+
const form = useForm<DeleteCloudHostedInput>({
392390
defaultValues: {
393-
teamId,
394391
deploymentId: instance.deploymentId,
395392
},
396393
reValidateMode: "onChange",
397394
});
398395

399-
const onSubmit = (data: DeleteDeploymentInput) => {
400-
deleteDeploymentMutation.mutate(data, {
396+
const onSubmit = (data: DeleteCloudHostedInput) => {
397+
deleteCloudHosted.mutate(data, {
401398
onSuccess: () => {
402399
toast.success("Deleting Engine. Please check again in a few minutes.", {
403400
dismissible: true,
@@ -494,14 +491,12 @@ function DeleteSubscriptionModalContent(props: {
494491
variant="destructive"
495492
disabled={
496493
!ackDeletion ||
497-
deleteDeploymentMutation.isPending ||
494+
deleteCloudHosted.isPending ||
498495
!form.formState.isValid
499496
}
500497
className="gap-2"
501498
>
502-
{deleteDeploymentMutation.isPending && (
503-
<Spinner className="size-4" />
504-
)}
499+
{deleteCloudHosted.isPending && <Spinner className="size-4" />}
505500
Permanently Delete Engine
506501
</Button>
507502
</DialogFooter>

apps/dashboard/src/data/analytics/fetch-analytics.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ export async function fetchAnalytics(
44
input: string | URL,
55
init?: RequestInit,
66
): Promise<Response> {
7-
return;
8-
97
const [pathname, searchParams] = input.toString().split("?");
108
if (!pathname) {
119
throw new Error("Invalid input, no pathname provided");

0 commit comments

Comments
 (0)