More typing and fixes

This commit is contained in:
Sean Edmunds
2025-04-25 15:02:00 -05:00
parent 74893ac68d
commit b280909ec9
31 changed files with 230 additions and 110 deletions

View File

@@ -3,12 +3,12 @@ import { useRef } from 'react';
import { Flip, toast } from 'react-toastify';
const url = `${import.meta.env.PROD ? import.meta.env.VITE_DOMAIN_PROD : import.meta.env.VITE_DOMAIN_DEV}/${import.meta.env.VITE_BASE_URL}`;
const headers = {
const headers: HeadersInit = {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': '*',
'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
'Access-Control-Allow-Credentials': true,
'Access-Control-Allow-Credentials': 'true',
'Sec-Fetch-Mode': 'no-cors',
'Sec-Fetch-Site': 'same-site',
};
@@ -49,7 +49,7 @@ export function useMutationAPI() {
endpoint: string,
body: object | undefined | null,
) => {
const options: any = {
const options: { method: string; headers: HeadersInit | undefined; body: string } = {
method: method,
headers: headers,
body: JSON.stringify(body),

View File

@@ -13,7 +13,7 @@ export function useCommonHooks() {
key: 'theme',
defaultValue: 'blackboard',
});
const [appFilter, setAppFilter] = useLocalStorage<[string]>({
const [appFilter, setAppFilter] = useLocalStorage<string[]>({
key: 'appFilter',
defaultValue: ['All'],
});
@@ -29,7 +29,7 @@ export function useCommonHooks() {
key: 'bookmarkSort',
defaultValue: 'A>Z',
});
const [bookmarkFilter, setBookmarkFilter] = useLocalStorage<[string]>({
const [bookmarkFilter, setBookmarkFilter] = useLocalStorage<string[]>({
key: 'bookmarkFilter',
defaultValue: ['All'],
});