parent
bb96fe4774
commit
ce1f986609
1 changed files with 9 additions and 0 deletions
@ -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) |
||||
} |
Loading…
Reference in new issue