Skip to content

Commit 6fb4a1a

Browse files
luizhf42gustavosbarreto
authored andcommitted
refactor(ui): use injected isAdmin in DataTable
1 parent 39151c9 commit 6fb4a1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/src/components/DataTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</template>
5959

6060
<script setup lang="ts">
61-
import { computed } from "vue";
61+
import { computed, inject } from "vue";
6262
6363
type Header = {
6464
text: string;
@@ -79,7 +79,7 @@ defineEmits(["update:sort"]);
7979
const page = defineModel<number>("page", { required: true, type: Number });
8080
const itemsPerPage = defineModel("itemsPerPage", { required: true, type: Number });
8181
const pageQuantity = computed(() => Math.ceil(props.totalCount / itemsPerPage.value) || 1);
82-
const isAdmin = window.location.pathname.startsWith("/admin");
82+
const isAdmin: boolean = inject("isAdmin", false);
8383
8484
const goToFirstPage = () => { page.value = 1; };
8585
</script>

0 commit comments

Comments
 (0)