fix: page usersList
This commit is contained in:
1
bo/components.d.ts
vendored
1
bo/components.d.ts
vendored
@@ -60,6 +60,7 @@ declare module 'vue' {
|
|||||||
UPagination: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Pagination.vue')['default']
|
UPagination: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Pagination.vue')['default']
|
||||||
USelect: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Select.vue')['default']
|
USelect: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Select.vue')['default']
|
||||||
USelectMenu: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/SelectMenu.vue')['default']
|
USelectMenu: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/SelectMenu.vue')['default']
|
||||||
|
UsersList: typeof import('./src/components/admin/UsersList.vue')['default']
|
||||||
USidebar: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Sidebar.vue')['default']
|
USidebar: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Sidebar.vue')['default']
|
||||||
UTable: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Table.vue')['default']
|
UTable: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Table.vue')['default']
|
||||||
UTabs: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Tabs.vue')['default']
|
UTabs: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Tabs.vue')['default']
|
||||||
|
|||||||
39
bo/src/components/admin/UsersList.vue
Normal file
39
bo/src/components/admin/UsersList.vue
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<template>
|
||||||
|
<component :is="Default || 'div'">
|
||||||
|
<div class="flex flex-col md:flex-row gap-10">
|
||||||
|
<CategoryMenu />
|
||||||
|
<div class="w-full flex flex-col items-center gap-4">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</component>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import Default from '@/layouts/default.vue';
|
||||||
|
import { onMounted, ref} from 'vue'
|
||||||
|
import { useFetchJson } from '@/composable/useFetchJson';
|
||||||
|
|
||||||
|
const usersList = ref([])
|
||||||
|
const error=ref()
|
||||||
|
|
||||||
|
async function fetchUsersList() {
|
||||||
|
error.value = null
|
||||||
|
try {
|
||||||
|
const data = await useFetchJson(`/api/v1/restricted/customer/list`)
|
||||||
|
console.log('USERS LIST:', data)
|
||||||
|
|
||||||
|
const response = (data as any).items ?? data
|
||||||
|
console.log('User list response:', response)
|
||||||
|
usersList.value = response
|
||||||
|
|
||||||
|
return response
|
||||||
|
} catch (err: any) {
|
||||||
|
error.value = err?.message ?? 'Unknown error'
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted( ()=>{
|
||||||
|
fetchUsersList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user