mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-26 06:18:04 +00:00
Rename frontend directory (#472)
* Rename directory * Cleanup * Recover lost images * remove lint
This commit is contained in:
34
frontend/src/API/other.ts
Normal file
34
frontend/src/API/other.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import {
|
||||
type UseMutationOptions,
|
||||
type UseQueryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
} from "@tanstack/react-query";
|
||||
import { ApplicationStatus } from "./interfaces";
|
||||
import apiService from "./apiService";
|
||||
|
||||
// Shuts down the Helm Dashboard application
|
||||
export function useShutdownHelmDashboard(
|
||||
options?: UseMutationOptions<void, Error>
|
||||
) {
|
||||
return useMutation<void, Error>(
|
||||
() =>
|
||||
apiService.fetchWithDefaults("/", {
|
||||
method: "DELETE",
|
||||
}),
|
||||
options
|
||||
);
|
||||
}
|
||||
|
||||
// Gets application status
|
||||
export function useGetApplicationStatus(
|
||||
options?: UseQueryOptions<ApplicationStatus>
|
||||
) {
|
||||
return useQuery<ApplicationStatus>(
|
||||
["status"],
|
||||
() => apiService.fetchWithDefaults<ApplicationStatus>("/status"),
|
||||
{
|
||||
...options,
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user