feat: hackathon

This commit is contained in:
Maulana Sodiqin
2025-11-25 01:47:56 +07:00
parent 5a99f216cb
commit 9e9bfc2793
53 changed files with 6892 additions and 927 deletions
+6 -24
View File
@@ -1,28 +1,10 @@
import { TRegisterRequest, usePostRegister } from '@imphnen-frontend-service/service';
import { toast } from 'sonner';
import { useNavigate } from 'react-router';
// Registration is handled through GitHub OAuth
// This hook is kept for backward compatibility but is not used
export const useRegister = () => {
const navigate = useNavigate();
const { mutate, isPending } = usePostRegister();
const register = (payload: TRegisterRequest) => {
mutate(payload, {
onSuccess: (data) => {
toast.success('Berhasil Registrasi');
navigate(`/auth/register/otp?email=${payload.email}`);
},
onError: (err) => {
toast.error(
err?.response?.data?.message ??
'Terjadi Kesalahan yang tidak diketahui'
);
},
});
};
return {
register,
isLoading: isPending,
register: () => {
console.warn('Registration is handled through GitHub OAuth');
},
isLoading: false,
};
};