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