More typing and fixes
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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'],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user