mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-18 15:57:31 -03:00
Arreglado error de ts
This commit is contained in:
@@ -8,17 +8,17 @@
|
|||||||
import Loader2Icon from '@lucide/svelte/icons/loader-2';
|
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);
|
let cargando = $state(false);
|
||||||
|
|
||||||
const handleSubmit = async (e: Event) => {
|
const handleSubmit = async (e: SubmitEvent) => {
|
||||||
cargando = true;
|
cargando = true;
|
||||||
await login(e, dto, setAlert);
|
await login(e, dto, setAlert);
|
||||||
cargando = false;
|
cargando = false;
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Card.Root class="mx-auto w-full max-w-sm">
|
<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 { sesionStore } from "@/stores/usuario";
|
||||||
import { goto } from "$app/navigation";
|
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();
|
e.preventDefault();
|
||||||
if (dto.password == "" || dto.username == "") return;
|
if (dto.password == "" || dto.username == "") return;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user