diff --git a/frontend/src/hooks/create/useCreateTransaction.ts b/frontend/src/hooks/create/useCreateTransaction.ts new file mode 100644 index 0000000..2c20439 --- /dev/null +++ b/frontend/src/hooks/create/useCreateTransaction.ts @@ -0,0 +1,9 @@ +import { useAppContext } from '../../contexts/AppContext' +import { Transaction } from '../../types' + +export const useCreateTransaction = () => { + const api = useAppContext() + + return (body: Omit): Promise => + api.post('/transactions', body) +}