add useCreateTransaction

This commit is contained in:
Ievgen Dilevskyi 2021-07-14 17:11:53 -06:00
parent bb96fe4774
commit ce1f986609

View File

@ -0,0 +1,9 @@
import { useAppContext } from '../../contexts/AppContext'
import { Transaction } from '../../types'
export const useCreateTransaction = () => {
const api = useAppContext()
return (body: Omit<Transaction, 'id'>): Promise<Transaction> =>
api.post<Transaction>('/transactions', body)
}