user dtos as strict object templates
Some checks failed
Build and Deploy API / build-and-deploy (push) Failing after 6s
Build and Deploy Frontend / build-and-deploy (push) Successful in 7s

This commit is contained in:
2026-03-20 21:08:32 -05:00
parent 7229e369ae
commit 109d5f88ea
7 changed files with 28 additions and 29 deletions

View File

@@ -4,13 +4,14 @@
import { onMounted, reactive } from "vue";
import { useRoute, useRouter } from "vue-router";
import type { LoginDto } from "../models/User.ts";
import * as authApi from "../api/AuthApi";
const router = useRouter();
const user = reactive({
username: "",
password: ""
const user = reactive<LoginDto>({ // the template ensures type consistency
name: "",
password: "",
});
onMounted(() => {
@@ -37,7 +38,7 @@ async function login(): Promise<void> {
<h2>Login</h2>
<form @submit.prevent="login">
<input v-model="user.username" placeholder="username" />
<input v-model="user.name" placeholder="username" />
<input v-model="user.password" type="password" placeholder="password" />
<button type="submit">Submit</button>