add useCreateStack hook
This commit is contained in:
9
frontend/src/hooks/create/useCreateStack.ts
Normal file
9
frontend/src/hooks/create/useCreateStack.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { useAppContext } from '../../contexts/AppContext'
|
||||
import { Stack } from '../../types'
|
||||
|
||||
export const useCreateStack = () => {
|
||||
const api = useAppContext()
|
||||
|
||||
return (body: Omit<Stack, 'id'>): Promise<Stack> =>
|
||||
api.post<Stack>('/stacks', body)
|
||||
}
|
Reference in New Issue
Block a user