fix(web): TS typings and always active navbar link (#470)

* fix TS typings since `yarn build` was failing on my machine.
* fixed the dashboard navlink (it was always active on my end)
This commit is contained in:
stacksmash76 2022-09-23 19:03:00 +02:00 committed by GitHub
parent 8a782a5cab
commit 553320bf1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 60 additions and 35 deletions

View file

@ -394,6 +394,18 @@ interface UpdateProps {
notification: Notification;
}
interface InitialValues {
id: number;
enabled: boolean;
type: NotificationType;
name: string;
webhook?: string;
token?: string;
api_key?: string;
channel?: string;
events: NotificationEvent[];
}
export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateProps) {
const mutation = useMutation(
(notification: Notification) => APIClient.notifications.update(notification),
@ -437,7 +449,7 @@ export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateP
testMutation.mutate(data as Notification);
};
const initialValues = {
const initialValues: InitialValues = {
id: notification.id,
enabled: notification.enabled,
type: notification.type,
@ -450,7 +462,7 @@ export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateP
};
return (
<SlideOver
<SlideOver<InitialValues>
type="UPDATE"
title="Notification"
isOpen={isOpen}