mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
Refactor register page
This commit is contained in:
parent
82fea0ceee
commit
41a938cec0
24 changed files with 292 additions and 196 deletions
22
surfsense_web/atoms/auth/auth-mutation.atoms.ts
Normal file
22
surfsense_web/atoms/auth/auth-mutation.atoms.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { atomWithMutation } from "jotai-tanstack-query";
|
||||
import type { LoginRequest, RegisterRequest } from "@/contracts/types/auth.types";
|
||||
import { authApiService } from "@/lib/apis/auth-api.service";
|
||||
import { cacheKeys } from "@/lib/query-client/cache-keys";
|
||||
|
||||
export const registerMutationAtom = atomWithMutation(() => {
|
||||
return {
|
||||
mutationKey: cacheKeys.auth.user,
|
||||
mutationFn: async (request: RegisterRequest) => {
|
||||
return authApiService.register(request);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
export const loginMutationAtom = atomWithMutation(() => {
|
||||
return {
|
||||
mutationKey: cacheKeys.auth.user,
|
||||
mutationFn: async (request: LoginRequest) => {
|
||||
return authApiService.login(request);
|
||||
},
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue