Skip to content

feat: add warning message when trying to delete active template #10142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 10, 2023
Prev Previous commit
fix: update call site for workspaces key
  • Loading branch information
Parkreiner committed Oct 9, 2023
commit fd220d980654b33caec26fc35b3ad142d30ed1ef
4 changes: 2 additions & 2 deletions site/src/pages/TemplatePage/TemplatePageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link as RouterLink, useNavigate } from "react-router-dom";
import { useDeletionDialogState } from "./useDeletionDialogState";

import { useQuery } from "react-query";
import { workspacesByQuery } from "api/queries/workspaces";
import { workspaces } from "api/queries/workspaces";
import { ConfirmDialog } from "components/Dialogs/ConfirmDialog/ConfirmDialog";
import {
AuthorizationResponse,
Expand Down Expand Up @@ -52,7 +52,7 @@ const TemplateMenu: FC<TemplateMenuProps> = ({

const queryText = `template:${templateName}`;
const workspaceCountQuery = useQuery({
...workspacesByQuery(queryText),
...workspaces({ q: queryText }),
select: (res) => res.count,
Copy link
Member

Choose a reason for hiding this comment

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

TIL!

});

Expand Down