diff --git a/src/layouts/AppLayout.vue b/src/layouts/AppLayout.vue index 4c87a39..d64bbcb 100644 --- a/src/layouts/AppLayout.vue +++ b/src/layouts/AppLayout.vue @@ -6,6 +6,7 @@ const route = useRoute(); const isProducts = computed(() => route.path.startsWith("/products")); const isOrders = computed(() => route.path.startsWith("/orders")); +const isPayments = computed(() => route.path.startsWith("/payments")); const linkClass = (active: boolean) => [ @@ -43,6 +44,13 @@ const linkClass = (active: boolean) => Orders + + Payments + + +import { onMounted, ref } from "vue"; + +const items = ref([]); +const loading = ref(true); + +onMounted(async () => { + try { + const r = await fetch("/api/payments/payments", { + headers: { Accept: "application/json" }, + }); + items.value = await r.json(); + } finally { + loading.value = false; + } +}); + + + + + + Payments + Check all payments + + + + + v0 + + + + + Payment + + Loading… + + + + {{ p.name }} + {{ p.total_cost }} {{ p.currency }} + + + + diff --git a/src/router.ts b/src/router.ts index 29680eb..66bd694 100644 --- a/src/router.ts +++ b/src/router.ts @@ -4,6 +4,7 @@ import ProductsPage from "./pages/ProductsPage.vue"; import ProductDetailPage from "./pages/ProductDetailPage.vue"; import NotFoundPage from "./pages/NotFoundPage.vue"; import OrdersPage from "./pages/OrdersPage.vue"; +import PaymentsPage from "./pages/PaymentsPage.vue"; const router = createRouter({ history: createWebHistory(), @@ -12,6 +13,7 @@ const router = createRouter({ { path: "/products", component: ProductsPage }, { path: "/products/:id", component: ProductDetailPage, props: true }, { path: "/orders", component: OrdersPage }, + { path: "/payments", component: PaymentsPage }, { path: "/:pathMatch(.*)*", component: NotFoundPage } ], });
Check all payments