Type fixes
This commit is contained in:
@@ -36,7 +36,7 @@ const BookmarkSettings = () => {
|
||||
const { data: bookmarkData, isFetching: bookmarkDataIsFetching } = useQueryAPI({
|
||||
endpoint: bookmarksEndpoint,
|
||||
});
|
||||
const bookmarks = bookmarkData || [];
|
||||
const bookmarks: Bookmark[] = bookmarkData || [];
|
||||
const categoriesEndpoint = 'api/bookmarkCategories';
|
||||
const { data: groupData, isFetched: groupsIsFetched } = useQueryAPI({
|
||||
endpoint: categoriesEndpoint,
|
||||
@@ -50,7 +50,7 @@ const BookmarkSettings = () => {
|
||||
const [debouncedGroupSearch] = useDebouncedValue(searchValue, 500);
|
||||
const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const foundBookmarkGroups = [
|
||||
const foundBookmarkGroups: BookmarkGroup[] = [
|
||||
...new Set(
|
||||
bookmarks
|
||||
.filter(
|
||||
@@ -68,7 +68,7 @@ const BookmarkSettings = () => {
|
||||
),
|
||||
),
|
||||
];
|
||||
const foundGroups = groupData.filter((a: BookmarkGroup) =>
|
||||
const foundGroups: BookmarkGroup[] = groupData.filter((a: BookmarkGroup) =>
|
||||
a.categoryName.toLowerCase().includes((debouncedGroupSearch as string).toLowerCase()),
|
||||
);
|
||||
const handleClose = () => {
|
||||
|
||||
@@ -46,7 +46,7 @@ const GuacamoleClients = () => {
|
||||
useQueryAPI({
|
||||
endpoint: endpoint,
|
||||
});
|
||||
const guacamoleClients =
|
||||
const guacamoleClients: GuacamoleClient[] =
|
||||
guacamoleClientsData.filter(
|
||||
(a: GuacamoleClient) =>
|
||||
a.clientName.toLowerCase().includes((debouncedSearch as string).toLowerCase()) ||
|
||||
|
||||
@@ -33,7 +33,7 @@ const MessageSettings = () => {
|
||||
const [debouncedSearch] = useDebouncedValue(searchValue, 500);
|
||||
const { isMobile, theme } = useCommonHooks();
|
||||
const { mutateAsync } = useMutationAPI();
|
||||
const messages =
|
||||
const messages: Message[] =
|
||||
messageData?.filter((m: Message) =>
|
||||
m.message.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
|
||||
) || [];
|
||||
|
||||
@@ -36,12 +36,14 @@ import SearchProviderSettingsItem from './SearchProviderSettingsItem';
|
||||
|
||||
const SearchProviderSettings = () => {
|
||||
const allIcons: any = { ...fa6, ...vsc, ...si };
|
||||
const defaultProvider = {
|
||||
const defaultProvider: Provider = {
|
||||
id: undefined,
|
||||
name: '',
|
||||
url: '',
|
||||
prefix: '',
|
||||
default: 0,
|
||||
enabled: 1,
|
||||
icon: null,
|
||||
};
|
||||
const form = useForm({
|
||||
initialValues: defaultProvider,
|
||||
@@ -57,7 +59,7 @@ const SearchProviderSettings = () => {
|
||||
});
|
||||
const [searchValue, setSearchValue] = useState<string | number>('');
|
||||
const [debouncedSearch] = useDebouncedValue(searchValue, 500);
|
||||
const providers =
|
||||
const providers: Provider[] =
|
||||
providerData
|
||||
.filter(
|
||||
(a: Provider) =>
|
||||
|
||||
Reference in New Issue
Block a user