Skip to content

Commit

Permalink
Add missing loading retry button (AdminRoomTypesIndex)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabr1n4W committed Jan 2, 2025
1 parent 1ba9546 commit 4621996
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion resources/js/views/AdminRoomTypesIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@
:current-page-report-template="paginator.getCurrentPageReportTemplate()"
striped-rows
row-hover
:loading="isBusy"
:loading="isBusy || loadingError"
:rows="settingsStore.getSetting('general.pagination_page_size')"
:pt="{
table: 'table-auto lg:table-fixed',
}"
>
<template #loading>
<LoadingRetryButton :error="loadingError" @reload="loadData()" />
</template>
<template #empty>
<InlineNote v-if="roomTypes.length === 0">{{
$t("admin.room_types.no_data")
Expand Down Expand Up @@ -137,6 +140,7 @@ const actionColumn = useActionColumn([
]);
const isBusy = ref(false);
const loadingError = ref(false);
const roomTypes = ref([]);
const nameSearch = ref("");
const filters = ref({
Expand All @@ -152,13 +156,16 @@ onMounted(() => {
*/
function loadData() {
isBusy.value = true;
loadingError.value = false;
api
.call("roomTypes")
.then((response) => {
roomTypes.value = response.data.data;
})
.catch((error) => {
api.error(error);
loadingError.value = true;
})
.finally(() => {
isBusy.value = false;
Expand Down

0 comments on commit 4621996

Please sign in to comment.