switch to monorepo structure
This commit is contained in:
14
packages/web/src/auth.ts
Normal file
14
packages/web/src/auth.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
|
||||
function useLogin() {
|
||||
return useMutation({
|
||||
mutationFn: async (creds: { username: string; password: string }) => {
|
||||
await fetch("/api/login", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(creds),
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export { useLogin }
|
Reference in New Issue
Block a user