Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/dashboard/src/@3rdweb-sdk/react/hooks/useEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export function useEngineRemoveFromDashboard() {
}

export interface DeleteCloudHostedInput {
engineId: string;
deploymentId: string;
reason: "USING_SELF_HOSTED" | "TOO_EXPENSIVE" | "MISSING_FEATURES" | "OTHER";
feedback: string;
Expand All @@ -273,12 +274,13 @@ export function useEngineDeleteCloudHosted() {

return useMutation({
mutationFn: async ({
engineId,
deploymentId,
reason,
feedback,
}: DeleteCloudHostedInput) => {
const res = await fetch(
`${THIRDWEB_API_HOST}/v2/engine/deployments/${deploymentId}/infrastructure/delete`,
`${THIRDWEB_API_HOST}/v2/engine/deployments/${deploymentId}/infrastructure/delete?engineId=${engineId}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels a little weird to have this in a query param for a POST request?

also isn't a deploymentId linked to an engineId already ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me handle this from the API server end. It's less explicit but should it should resolve for for most users and is the correct longer term approach.

{
method: "POST",
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ function DeleteSubscriptionModalContent(props: {
const [ackDeletion, setAckDeletion] = useState(false);
const form = useForm<DeleteCloudHostedInput>({
defaultValues: {
engineId: instance.id,
deploymentId: instance.deploymentId,
},
reValidateMode: "onChange",
Expand Down
Loading