add roles seeding
All checks were successful
Build and Deploy Frontend / build-and-deploy (push) Successful in 8s
Build and Deploy API / build-and-deploy (push) Successful in 11s

This commit is contained in:
2026-04-21 19:13:44 -05:00
parent 214f1601b5
commit 2f3cb46af3
3 changed files with 36 additions and 19 deletions

View File

@@ -3,14 +3,14 @@
import { onMounted } from "vue"
import { useRoute, useRouter } from "vue-router";
import { useUsersStore } from "../stores/UsersStore.ts"
import { useItemsStore } from "../stores/ItemsStore.ts"
import * as authApi from "../api/AuthApi";
const store = useUsersStore()
const store = useItemsStore()
const router = useRouter();
onMounted(() => {
store.fetchUsers()
store.fetchItems()
})
function logout() {
@@ -22,13 +22,20 @@ function logout() {
<template>
<div>
<h1>Users</h1>
<h1>Items</h1>
<router-link to="/item/new">Create Item</router-link>
<table>
<tr v-for="user in store.users" :key="user.id">
<td>{{ user.username }}</td>
<tr v-for="item in store.items" :key="item.id">
<td>{{ item.name }}</td>
<td>
<button @click="store.removeUser(user.id)">Delete</button>
<router-link :to="`/item/${item.id}`" custom v-slot="{ navigate }">
<button @click="navigate" role="link">Edit</button>
</router-link>
<button @click="store.removeItem(item.id)">Delete</button>
</td>
</tr>
</table>