Added git hooks
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
GroupSetFactoryArrayBody,
|
||||
SetFactoryArrayBody
|
||||
} from '../../src/types/ApiSchemasFrontend'
|
||||
import {NextRouter, useRouter} from 'next/router'
|
||||
import { NextRouter, useRouter } from 'next/router'
|
||||
|
||||
interface Props {
|
||||
children: ReactNodeLike
|
||||
@@ -93,7 +93,7 @@ interface StoredFile {
|
||||
}
|
||||
|
||||
export const postFetchJson = async (router: NextRouter, url: string, body: unknown) => {
|
||||
const res = await fetch(router.basePath+url, {
|
||||
const res = await fetch(router.basePath + url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
@@ -129,7 +129,7 @@ export const GroupProvider: FC<Props> = ({ children, id, initial }) => {
|
||||
factories: val
|
||||
} as SetFactoryArrayBody).catch(console.error)
|
||||
},
|
||||
[id]
|
||||
[id, router]
|
||||
)
|
||||
|
||||
const setBasicValues = useCallback<typeof _setBasicValues>(
|
||||
@@ -140,7 +140,7 @@ export const GroupProvider: FC<Props> = ({ children, id, initial }) => {
|
||||
factories: val
|
||||
} as SetFactoryArrayBody).catch(console.error)
|
||||
},
|
||||
[id]
|
||||
[id, router]
|
||||
)
|
||||
|
||||
const addGroup = useCallback(
|
||||
@@ -180,7 +180,7 @@ export const GroupProvider: FC<Props> = ({ children, id, initial }) => {
|
||||
})().catch(console.error)
|
||||
return true
|
||||
},
|
||||
[groups, id]
|
||||
[groups, id, router]
|
||||
)
|
||||
const removeGroup = useCallback(
|
||||
(name: string) => {
|
||||
@@ -195,7 +195,7 @@ export const GroupProvider: FC<Props> = ({ children, id, initial }) => {
|
||||
{}
|
||||
).catch(console.error)
|
||||
},
|
||||
[id]
|
||||
[id, router]
|
||||
)
|
||||
const renameGroup = useCallback(
|
||||
(name: string, newName: string) => {
|
||||
@@ -215,7 +215,7 @@ export const GroupProvider: FC<Props> = ({ children, id, initial }) => {
|
||||
} as GroupRenameBody
|
||||
).catch(console.error)
|
||||
},
|
||||
[groups, id]
|
||||
[groups, id, router]
|
||||
)
|
||||
|
||||
const setFactories = useCallback(
|
||||
@@ -234,7 +234,7 @@ export const GroupProvider: FC<Props> = ({ children, id, initial }) => {
|
||||
} as GroupSetFactoryArrayBody
|
||||
).catch(console.error)
|
||||
},
|
||||
[id]
|
||||
[id, router]
|
||||
)
|
||||
const getInputType = useCallback(
|
||||
(uid: string) => {
|
||||
|
||||
@@ -4,12 +4,12 @@ import styles from './Home.module.css'
|
||||
import { useFactories } from '../../src/hooks/useFactories'
|
||||
import { EnrichedEntity } from '../../src/types'
|
||||
import { EntitySpan } from './EntitySpan/EntitySpan'
|
||||
import {postFetchJson, useGroups} from '../contexts/GroupProvider'
|
||||
import { postFetchJson, useGroups } from '../contexts/GroupProvider'
|
||||
import { Preferences } from './Preferences/Preferences'
|
||||
import { download, streamToArrayBuffer } from '../../src/download'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import {UploadDataBody} from '../../src/types/ApiSchemasFrontend'
|
||||
import { UploadDataBody } from '../../src/types/ApiSchemasFrontend'
|
||||
|
||||
export const Home: FC = () => {
|
||||
const router = useRouter()
|
||||
@@ -50,7 +50,13 @@ export const Home: FC = () => {
|
||||
Store
|
||||
</button>
|
||||
<button
|
||||
onClick={() => postFetchJson(router, `/api/${router.query.id}/upload`, { groups, ignored: ignoredFactories, base: baseFactories } as UploadDataBody)}
|
||||
onClick={() =>
|
||||
postFetchJson(router, `/api/${router.query.id}/upload`, {
|
||||
groups,
|
||||
ignored: ignoredFactories,
|
||||
base: baseFactories
|
||||
} as UploadDataBody)
|
||||
}
|
||||
>
|
||||
Upload
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user