add useCreateTransaction
This commit is contained in:
		
							
								
								
									
										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) | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user