Move manager routes under /admin
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['manager-only'],
|
||||
path: '/admin/bonuses/balances/:userId',
|
||||
alias: ['/bonus-system/:userId'],
|
||||
});
|
||||
|
||||
type TransactionItem = ManagerBonusAccountQuery['managerBonusAccount']['transactions'][number];
|
||||
@@ -37,7 +39,7 @@ function formatDateTime(value: string) {
|
||||
|
||||
<template>
|
||||
<section class="space-y-6">
|
||||
<NuxtLink to="/bonus-system" class="text-sm font-semibold text-[#0d854a]">← Назад к бонусам</NuxtLink>
|
||||
<NuxtLink to="/admin/bonuses/balances" class="text-sm font-semibold text-[#0d854a]">← Назад к бонусам</NuxtLink>
|
||||
|
||||
<div v-if="bonusAccountQuery.loading.value" class="manager-empty-state">
|
||||
Загружаем бонусный счёт...
|
||||
@@ -79,7 +81,7 @@ function formatDateTime(value: string) {
|
||||
</div>
|
||||
|
||||
<NuxtLink
|
||||
:to="`/bonus-system/withdrawals/${withdrawal.id}`"
|
||||
:to="`/admin/bonuses/requests/${withdrawal.id}`"
|
||||
class="text-sm font-semibold text-[#0d854a]"
|
||||
>
|
||||
Проверить выплату
|
||||
@@ -111,7 +113,7 @@ function formatDateTime(value: string) {
|
||||
|
||||
<NuxtLink
|
||||
v-if="transaction.orderId"
|
||||
:to="`/client-orders/${transaction.orderId}`"
|
||||
:to="`/admin/orders/${transaction.orderId}`"
|
||||
class="text-sm font-semibold text-[#0d854a]"
|
||||
>
|
||||
Открыть заказ
|
||||
|
||||
@@ -14,6 +14,8 @@ import { messengerConnectionAvatarSrc } from '~/composables/useMessengerConnecti
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['manager-only'],
|
||||
path: '/admin/bonuses/:section(balances|requests|rewards)?',
|
||||
alias: ['/bonus-system'],
|
||||
});
|
||||
|
||||
type BalanceItem = ManagerBonusBalancesQuery['managerBonusBalances'][number];
|
||||
@@ -38,10 +40,10 @@ const withdrawalsQuery = useQuery(ManagerWithdrawalRequestsDocument, {
|
||||
});
|
||||
|
||||
const activeTab = computed<'balances' | 'withdrawals' | 'rewards'>(() => {
|
||||
if (route.query.tab === 'withdrawals') {
|
||||
if (route.path === '/admin/bonuses/requests') {
|
||||
return 'withdrawals';
|
||||
}
|
||||
if (route.query.tab === 'rewards' || route.query.tab === 'products' || route.query.tab === 'manager') {
|
||||
if (route.path === '/admin/bonuses/rewards') {
|
||||
return 'rewards';
|
||||
}
|
||||
return 'balances';
|
||||
@@ -316,7 +318,7 @@ function productVisualLabel(product: ProductCard) {
|
||||
<UsersGridCard
|
||||
v-for="item in visibleBalances"
|
||||
:key="item.userId"
|
||||
:to="`/bonus-system/${item.userId}`"
|
||||
:to="`/admin/bonuses/balances/${item.userId}`"
|
||||
:full-name="item.fullName"
|
||||
:avatar-src="messengerConnectionAvatarSrc(usersById.get(item.userId)?.telegramConnection)"
|
||||
:initials="userInitials(item.fullName)"
|
||||
@@ -379,7 +381,7 @@ function productVisualLabel(product: ProductCard) {
|
||||
<NuxtLink
|
||||
v-for="withdrawal in visibleWithdrawals"
|
||||
:key="withdrawal.id"
|
||||
:to="`/bonus-system/withdrawals/${withdrawal.id}`"
|
||||
:to="`/admin/bonuses/requests/${withdrawal.id}`"
|
||||
class="surface-card surface-card-interactive block rounded-[30px] bg-white px-4 py-4 md:px-5"
|
||||
>
|
||||
<div class="grid gap-4 md:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_180px_140px] md:items-center md:gap-6">
|
||||
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['manager-only'],
|
||||
path: '/admin/bonuses/referrals/new',
|
||||
alias: ['/bonus-system/referrals/new'],
|
||||
});
|
||||
|
||||
type ManagerUserItem = ManagerUsersQuery['managerUsers'][number];
|
||||
@@ -91,15 +93,17 @@ async function createReferral() {
|
||||
createdReferralId.value = response?.data?.createReferral.id ?? '';
|
||||
refereeUserId.value = '';
|
||||
await linksQuery.refetch();
|
||||
} catch (error: any) {
|
||||
errorMessage.value = error?.message || 'Не удалось создать бонусную связку.';
|
||||
} catch (error: unknown) {
|
||||
errorMessage.value = error instanceof Error
|
||||
? error.message
|
||||
: 'Не удалось создать бонусную связку.';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="space-y-6 max-w-3xl">
|
||||
<NuxtLink to="/bonus-system" class="text-sm font-semibold text-[#0d854a]">← Назад к бонусам</NuxtLink>
|
||||
<NuxtLink to="/admin/bonuses/balances" class="text-sm font-semibold text-[#0d854a]">← Назад к бонусам</NuxtLink>
|
||||
|
||||
<div class="manager-hero">
|
||||
<p class="manager-eyebrow">Бонусы</p>
|
||||
|
||||
@@ -4,6 +4,8 @@ import { AddBonusTransactionDocument } from '~/composables/graphql/generated';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['manager-only'],
|
||||
path: '/admin/bonuses/transactions/new',
|
||||
alias: ['/bonus-system/transactions/new'],
|
||||
});
|
||||
|
||||
const userId = ref('');
|
||||
@@ -29,7 +31,7 @@ async function addBonus() {
|
||||
|
||||
<template>
|
||||
<section class="space-y-6 max-w-3xl">
|
||||
<NuxtLink to="/bonus-system" class="text-sm font-semibold text-[#0d854a]">← Назад к бонусам</NuxtLink>
|
||||
<NuxtLink to="/admin/bonuses/balances" class="text-sm font-semibold text-[#0d854a]">← Назад к бонусам</NuxtLink>
|
||||
|
||||
<div class="manager-hero">
|
||||
<p class="manager-eyebrow">Бонусы</p>
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['manager-only'],
|
||||
path: '/admin/bonuses/requests/:id',
|
||||
alias: ['/bonus-system/withdrawals/:id'],
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
@@ -47,7 +49,7 @@ async function reviewWithdrawal() {
|
||||
|
||||
<template>
|
||||
<section class="space-y-6 max-w-3xl">
|
||||
<NuxtLink to="/bonus-system" class="text-sm font-semibold text-[#0d854a]">← Назад к бонусам</NuxtLink>
|
||||
<NuxtLink to="/admin/bonuses/requests" class="text-sm font-semibold text-[#0d854a]">← Назад к бонусам</NuxtLink>
|
||||
|
||||
<div v-if="withdrawalsQuery.loading.value" class="manager-empty-state">
|
||||
Загружаем заявку на вывод...
|
||||
|
||||
Reference in New Issue
Block a user