REST Service for POPCORN - ILIAS
alex
2025-06-03 d70351c84732844b76b7f1992b60114619eb6381
vue/src/pages/Users.vue
@@ -2,6 +2,7 @@
import {onMounted, reactive, ref} from "vue"
import {useRoute} from "vue-router"
import Pagination from "../components/Pagination.vue"
const route = useRoute()
const userId = route.params.userId
@@ -18,8 +19,8 @@
/////////////////////////////////////////////////////////////////////////
async function init () {
   const res = await fetch(`/api/users?limit=${limit}&token=jiuGfr432898D90290kjfsldkfn3hh8F`)
async function init (offset = 0) {
   const res = await fetch(`/api/users?offset=${offset}&limit=${limit}&token=jiuGfr432898D90290kjfsldkfn3hh8F`)
   const data = await res.json()
   console.log(data)
   if (res.status === 200) {
@@ -28,6 +29,11 @@
   else {
      error.value = `ERROR: ${res.status}`
   }
}
function go (offset) {
   console.log("go", offset)
   return init(offset)
}
</script>
@@ -39,7 +45,7 @@
      <h1>
         Users
         <small>
            {{users.offset}} - {{users.offset+users.limit}} von {{users.total}}
            {{users.offset}} - {{users.offset+users.data.length}} von {{users.total}}
         </small>
      </h1>
      <p>{{ userId }}</p>
@@ -47,7 +53,7 @@
      <div class="users">
         <Pagination :offset="users.offset" :limit="users.limit" :total="users.total" @go="go" />
         <table class="w100p">
            <thead>