Merge branch 'main' of github.com:dank-inc/cash-stacks into main
This commit is contained in:
commit
c62f88953e
9
frontend/src/hooks/create/useCreateAccount.ts
Normal file
9
frontend/src/hooks/create/useCreateAccount.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { useAppContext } from '../../contexts/AppContext'
|
||||
import { Account } from '../../types'
|
||||
|
||||
export const useCreateAccount = () => {
|
||||
const api = useAppContext()
|
||||
|
||||
return (body: Omit<Account, 'id'>): Promise<Account> =>
|
||||
api.post<Account>('/accounts', body)
|
||||
}
|
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)
|
||||
}
|
9
frontend/src/hooks/create/useCreateTransaction.ts
Normal file
9
frontend/src/hooks/create/useCreateTransaction.ts
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user