Skip to content

Commit

Permalink
Replace route props
Browse files Browse the repository at this point in the history
It created an issue where the build wasn't successful because the global component was called in the view without the prop.
  • Loading branch information
lcharette committed Jan 14, 2025
1 parent 91f0bd7 commit ece99b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/sprinkle-admin/app/assets/routes/UserRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default [
path: 'u/:user_name', // users/u/{user_name}
name: 'admin.user',
component: () => import('../views/UserView.vue'),
props: true,
meta: {
title: 'User Details',
description: 'View and edit user details.'
Expand Down
11 changes: 3 additions & 8 deletions packages/theme-pink-cupcake/src/views/Admin/UserPage.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useRoute } from 'vue-router'
import { watch } from 'vue'
import { usePageMeta } from '@userfrosting/sprinkle-core/composables'
import { useUserApi } from '@userfrosting/sprinkle-admin/composables'
Expand All @@ -7,18 +8,12 @@ import UserActivities from '../../components/Pages/Admin/User/UserActivities.vue
import UserRoles from '../../components/Pages/Admin/User/UserRoles.vue'
import UserPermissions from '../../components/Pages/Admin/User/UserPermissions.vue'
/**
* Props - Passed from the router
*/
const props = defineProps<{
user_name: string
}>()
/**
* Variables and composables
*/
const route = useRoute()
const page = usePageMeta()
const { user, error, fetchUser } = useUserApi(() => props.user_name)
const { user, error, fetchUser } = useUserApi(() => route.params.user_name)
/**
* Watcher - Match page title to the user full name
Expand Down

0 comments on commit ece99b0

Please sign in to comment.