mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-01 13:10:44 -03:00
Arreglado error de ts
This commit is contained in:
@@ -6,19 +6,19 @@
|
||||
import type { LoginDto } from '../../../../types';
|
||||
import { login } from '@/hooks/login';
|
||||
import Loader2Icon from '@lucide/svelte/icons/loader-2';
|
||||
let {id, showAlert = $bindable() } = $props();
|
||||
let { id, showAlert = $bindable() } = $props();
|
||||
|
||||
let dto: LoginDto = $state({password: "", username: ""});
|
||||
let dto: LoginDto = $state({ password: '', username: '' });
|
||||
|
||||
const setAlert = () => showAlert = true;
|
||||
const setAlert = () => (showAlert = true);
|
||||
|
||||
let cargando = $state(false);
|
||||
|
||||
const handleSubmit = async (e: Event) => {
|
||||
const handleSubmit = async (e: SubmitEvent) => {
|
||||
cargando = true;
|
||||
await login(e, dto, setAlert);
|
||||
cargando = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<Card.Root class="mx-auto w-full max-w-sm">
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { LoginDto } from "../../types";
|
||||
import { sesionStore } from "@/stores/usuario";
|
||||
import { goto } from "$app/navigation";
|
||||
|
||||
export async function login(e:FormDataEvent,dto: LoginDto, callbackfn:()=>void){
|
||||
export async function login(e:SubmitEvent, dto: LoginDto, callbackfn:()=>void){
|
||||
e.preventDefault();
|
||||
if (dto.password == "" || dto.username == "") return;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user