mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 06:35:21 +00:00
misc: moved away from dedicated slack admin config
This commit is contained in:
@@ -33,7 +33,11 @@ export const useCreateAdminUser = () => {
|
||||
export const useUpdateServerConfig = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<TServerConfig, {}, Partial<TServerConfig>>({
|
||||
return useMutation<
|
||||
TServerConfig,
|
||||
{},
|
||||
Partial<TServerConfig & { slackClientId: string; slackClientSecret: string }>
|
||||
>({
|
||||
mutationFn: async (opt) => {
|
||||
const { data } = await apiRequest.patch<{ config: TServerConfig }>(
|
||||
"/api/v1/admin/config",
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Button, FormControl, Input } from "@app/components/v2";
|
||||
import {
|
||||
useGetAdminSlackConfig,
|
||||
useGetCustomSlackAppCreationUrl,
|
||||
useUpdateAdminSlackConfig
|
||||
useUpdateServerConfig
|
||||
} from "@app/hooks/api";
|
||||
|
||||
const slackFormSchema = z.object({
|
||||
@@ -31,7 +31,7 @@ export const IntegrationPanel = () => {
|
||||
const { data: customSlackAppCreationUrl } = useGetCustomSlackAppCreationUrl();
|
||||
const { data: adminSlackConfig } = useGetAdminSlackConfig();
|
||||
|
||||
const { mutateAsync: updateAdminSlackConfig } = useUpdateAdminSlackConfig();
|
||||
const { mutateAsync: updateAdminServerConfig } = useUpdateServerConfig();
|
||||
|
||||
useEffect(() => {
|
||||
if (adminSlackConfig) {
|
||||
@@ -41,7 +41,10 @@ export const IntegrationPanel = () => {
|
||||
}, [adminSlackConfig]);
|
||||
|
||||
const onSlackFormSubmit = async (data: TSlackForm) => {
|
||||
await updateAdminSlackConfig(data);
|
||||
await updateAdminServerConfig({
|
||||
slackClientId: data.clientId,
|
||||
slackClientSecret: data.clientSecret
|
||||
});
|
||||
|
||||
createNotification({
|
||||
text: "Updated admin slack configuration",
|
||||
|
||||
Reference in New Issue
Block a user