diff --git a/frontend/src/hooks/create/useCreateAccount.ts b/frontend/src/hooks/create/useCreateAccount.ts new file mode 100644 index 0000000..a006005 --- /dev/null +++ b/frontend/src/hooks/create/useCreateAccount.ts @@ -0,0 +1,9 @@ +import { useAppContext } from '../../contexts/AppContext' +import { Account } from '../../types' + +export const useCreateAccount = () => { + const api = useAppContext() + + return (body: Omit): Promise => + api.post('/accounts', body) +} diff --git a/frontend/src/hooks/create/useCreateStack.ts b/frontend/src/hooks/create/useCreateStack.ts new file mode 100644 index 0000000..85e6472 --- /dev/null +++ b/frontend/src/hooks/create/useCreateStack.ts @@ -0,0 +1,9 @@ +import { useAppContext } from '../../contexts/AppContext' +import { Stack } from '../../types' + +export const useCreateStack = () => { + const api = useAppContext() + + return (body: Omit): Promise => + api.post('/stacks', body) +} 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) +}