Basic auctions index

This commit is contained in:
2026-01-18 01:25:58 +02:00
parent dfbcaafb77
commit 1c3bf5add6
2 changed files with 36 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<script setup>
import {ref, watch} from 'vue'
import {useStore} from '@nanostores/vue'
import {$user} from '../stores/user'
import * as gateway from '../lib/gateway.js'
const user = useStore($user)
const auctions = ref([])
watch(user, async (userVal) => {
if(userVal == null) return;
const response = await gateway.request('/auctions',
{cors: true, token: userVal.token, searchParams: {page: 1, per: 50}}
)
if (response.ok) {
auctions.value = await response.json()
}
}, {immediate: true})
</script>
<template>
<ul>
<li v-for="auction in auctions" :key="auction.id">{{ auction.summary }} {{ auction.current_bet || auction.min_bet }}</li>
</ul>
</template>
+8
View File
@@ -0,0 +1,8 @@
---
import Layout from "../../layouts/Layout.astro";
import AuctionsIndex from '../../components/auctions/Index.vue'
---
<Layout title="Auctions">
<AuctionsIndex client:load />
</Layout>