Move manager routes under /admin
This commit is contained in:
@@ -13,6 +13,8 @@ import { messengerConnectionAvatarSrc } from '~/composables/useMessengerConnecti
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['manager-only'],
|
||||
path: '/admin/orders/:mode(clients|requests)/:id',
|
||||
alias: ['/clients/:id'],
|
||||
});
|
||||
|
||||
type ManagerUserItem = ManagerUsersDetailQuery['managerUsers'][number];
|
||||
@@ -21,8 +23,9 @@ type RequestItem = RegistrationRequestsQuery['registrationRequests'][number];
|
||||
|
||||
const route = useRoute();
|
||||
const entityId = computed(() => String(route.params.id || ''));
|
||||
const isRequestMode = computed(() => route.query.tab === 'requests');
|
||||
const backTarget = computed(() => '/clients');
|
||||
const entityMode = computed(() => String(route.params.mode || 'clients'));
|
||||
const isRequestMode = computed(() => entityMode.value === 'requests');
|
||||
const backTarget = computed(() => '/admin/orders/clients');
|
||||
|
||||
const usersQuery = useQuery(ManagerUsersDetailDocument);
|
||||
const requestsQuery = useQuery(RegistrationRequestsDocument, {
|
||||
@@ -221,7 +224,7 @@ async function rejectRequest() {
|
||||
<OrdersOrderSummaryCard
|
||||
v-for="order in visibleUserOrders"
|
||||
:key="order.id"
|
||||
:to="`/client-orders/${order.id}`"
|
||||
:to="`/admin/orders/${order.id}`"
|
||||
:code="order.code"
|
||||
:status="order.status"
|
||||
:created-at="order.createdAt"
|
||||
|
||||
@@ -5,6 +5,8 @@ import { messengerConnectionAvatarSrc } from '~/composables/useMessengerConnecti
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['manager-only'],
|
||||
path: '/admin/orders/clients',
|
||||
alias: ['/clients'],
|
||||
});
|
||||
|
||||
const search = ref('');
|
||||
@@ -64,7 +66,7 @@ function userInitials(fullName: string) {
|
||||
search-placeholder="Имя, компания или email"
|
||||
>
|
||||
<template #controls>
|
||||
<NuxtLink to="/clients/invite" class="btn btn-primary border-0">
|
||||
<NuxtLink to="/admin/orders/clients/invite" class="btn btn-primary border-0">
|
||||
Пригласить
|
||||
</NuxtLink>
|
||||
</template>
|
||||
@@ -81,7 +83,7 @@ function userInitials(fullName: string) {
|
||||
<UsersGridCard
|
||||
v-for="user in visibleUsers"
|
||||
:key="user.id"
|
||||
:to="`/clients/${user.id}`"
|
||||
:to="`/admin/orders/clients/${user.id}`"
|
||||
:full-name="user.fullName"
|
||||
:avatar-src="messengerConnectionAvatarSrc(user.telegramConnection)"
|
||||
:initials="userInitials(user.fullName)"
|
||||
|
||||
@@ -4,6 +4,8 @@ import { CreateInvitationDocument } from '~/composables/graphql/generated';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['manager-only'],
|
||||
path: '/admin/orders/clients/invite',
|
||||
alias: ['/clients/invite'],
|
||||
});
|
||||
|
||||
const email = ref('');
|
||||
@@ -37,7 +39,7 @@ async function createInvitation() {
|
||||
|
||||
<template>
|
||||
<section class="space-y-6 max-w-3xl">
|
||||
<NuxtLink to="/clients" class="text-sm font-semibold text-[#0d854a]">← Назад к пользователям</NuxtLink>
|
||||
<NuxtLink to="/admin/orders/clients" class="text-sm font-semibold text-[#0d854a]">← Назад к пользователям</NuxtLink>
|
||||
|
||||
<div class="manager-hero">
|
||||
<p class="manager-eyebrow">Приглашение</p>
|
||||
|
||||
Reference in New Issue
Block a user