Skip to content

Commit ea1a529

Browse files
committed
fixed frontEnd useMutation hook to work properly
CoAuthors: James, Ben, Eric, Wilton
1 parent d4f9e7d commit ea1a529

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

www/src/pages/components/LandingPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import Blogs from './Blogs';
77
import { useState } from 'react';
88
import { trpc } from '../../utils/trpc';
99

10-
export default function LandingPage(): JSX.Element {
10+
export default function LandingPage() {
1111
const [name, setName] = useState('');
1212
const [email, setEmail] = useState('');
13+
const { mutate } = trpc.user.createUser.useMutation();
1314

1415
const handleSubmit = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
1516
e.preventDefault();
1617
// grab the information of name and email
1718
// bundle those together to be an object to be sent to backend
18-
const { mutate } = trpc.user.createUser.useMutation();
1919
mutate({name, email});
2020
}
2121

0 commit comments

Comments
 (0)