Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions resources/js/composables/useAppLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ export function useAppLayout() {
},
],
},
];

if (page.props.auth.isAdmin) {
items.push({
{
label: 'Admin',
lucideIcon: Lock,
visible: page.props.auth.isAdmin,
items: [
{
label: 'Dashboard',
Expand All @@ -80,8 +78,8 @@ export function useAppLayout() {
active: currentRoute.value == 'admin.users.index',
},
],
});
}
},
];

return items;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DataTableFilterMetaData, DataTableFilterEvent, DataTableSortEvent } fro
import { PrimeVueDataFilters, InertiaRouterFetchCallbacks } from '@/types';
import { usePaginatedData } from './usePaginatedData';

export function useLazyDataTable(
export function usePaginatedDataTable(
propDataToFetch: string | string[],
initialFilters: PrimeVueDataFilters = {},
initialRows: number = 20
Expand Down
4 changes: 2 additions & 2 deletions resources/js/pages/admin/users/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FilterMatchMode } from '@primevue/core/api';
import { AlertCircle, EllipsisVertical, FunnelX, Pencil } from 'lucide-vue-next';
import { formatInTimeZone } from 'date-fns-tz';
import { parseISO } from 'date-fns';
import { useLazyDataTable } from '@/composables/useLazyDataTable';
import { usePaginatedDataTable } from '@/composables/usePaginatedDataTable';
import AppLayout from '@/layouts/AppLayout.vue';
import ClientOnly from '@/components/ClientOnly.vue';
import Menu from '@/components/primevue/menu/Menu.vue';
Expand Down Expand Up @@ -52,7 +52,7 @@ const {
filter,
sort,
hardReset,
} = useLazyDataTable('users', {
} = usePaginatedDataTable('users', {
name: { value: null, matchMode: FilterMatchMode.CONTAINS },
email: { value: null, matchMode: FilterMatchMode.CONTAINS },
created_at: { value: null, matchMode: FilterMatchMode.DATE_IS },
Expand Down