style: fix prettier formatting
This commit is contained in:
@@ -21,7 +21,10 @@ export async function fetchTestChecklistResults(): Promise<TestChecklistResponse
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function updateTestChecklistItem(itemKey: string, passed: boolean): Promise<UpdateChecklistItemResponse> {
|
export async function updateTestChecklistItem(itemKey: string, passed: boolean): Promise<UpdateChecklistItemResponse> {
|
||||||
const { data } = await apiClient.patch<{ result: UpdateChecklistItemResponse }>('admin/test-checklist', { itemKey, passed })
|
const { data } = await apiClient.patch<{ result: UpdateChecklistItemResponse }>('admin/test-checklist', {
|
||||||
|
itemKey,
|
||||||
|
passed,
|
||||||
|
})
|
||||||
return data.result
|
return data.result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,17 @@ import Typography from '@mui/material/Typography'
|
|||||||
import useMediaQuery from '@mui/material/useMediaQuery'
|
import useMediaQuery from '@mui/material/useMediaQuery'
|
||||||
import { useQuery } from '@tanstack/react-query'
|
import { useQuery } from '@tanstack/react-query'
|
||||||
import { useUnit } from 'effector-react'
|
import { useUnit } from 'effector-react'
|
||||||
import { Bell, ClipboardCheck, Image, LayoutGrid, ListOrdered, MessageSquare, Settings, Store, Users } from 'lucide-react'
|
import {
|
||||||
|
Bell,
|
||||||
|
ClipboardCheck,
|
||||||
|
Image,
|
||||||
|
LayoutGrid,
|
||||||
|
ListOrdered,
|
||||||
|
MessageSquare,
|
||||||
|
Settings,
|
||||||
|
Store,
|
||||||
|
Users,
|
||||||
|
} from 'lucide-react'
|
||||||
import { Navigate, Route, Routes, useLocation, useNavigate } from 'react-router-dom'
|
import { Navigate, Route, Routes, useLocation, useNavigate } from 'react-router-dom'
|
||||||
import { fetchAdminOrdersSummary } from '@/entities/order/api/admin-order-api'
|
import { fetchAdminOrdersSummary } from '@/entities/order/api/admin-order-api'
|
||||||
import { AdminCategoriesPage } from '@/pages/admin-categories'
|
import { AdminCategoriesPage } from '@/pages/admin-categories'
|
||||||
|
|||||||
@@ -23,7 +23,11 @@ import Typography from '@mui/material/Typography'
|
|||||||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
|
||||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||||
import { TEST_CHECKLIST_ITEMS } from '@shared/constants/test-checklist-items'
|
import { TEST_CHECKLIST_ITEMS } from '@shared/constants/test-checklist-items'
|
||||||
import { fetchTestChecklistResults, resetTestChecklist, updateTestChecklistItem } from '@/entities/test-checklist/api/test-checklist-api'
|
import {
|
||||||
|
fetchTestChecklistResults,
|
||||||
|
resetTestChecklist,
|
||||||
|
updateTestChecklistItem,
|
||||||
|
} from '@/entities/test-checklist/api/test-checklist-api'
|
||||||
|
|
||||||
function formatDate(iso: string): string {
|
function formatDate(iso: string): string {
|
||||||
return new Date(iso).toLocaleString('ru-RU', {
|
return new Date(iso).toLocaleString('ru-RU', {
|
||||||
@@ -86,7 +90,12 @@ export function AdminTestChecklistPage() {
|
|||||||
Пройдено: {passedCount} из {total}
|
Пройдено: {passedCount} из {total}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Button variant="outlined" color="warning" onClick={() => setConfirmOpen(true)} disabled={resetMutation.isPending}>
|
<Button
|
||||||
|
variant="outlined"
|
||||||
|
color="warning"
|
||||||
|
onClick={() => setConfirmOpen(true)}
|
||||||
|
disabled={resetMutation.isPending}
|
||||||
|
>
|
||||||
Сбросить все
|
Сбросить все
|
||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -99,7 +108,11 @@ export function AdminTestChecklistPage() {
|
|||||||
<Alert severity="error">Не удалось загрузить чеклист.</Alert>
|
<Alert severity="error">Не удалось загрузить чеклист.</Alert>
|
||||||
) : (
|
) : (
|
||||||
sections.map(([section, items]) => (
|
sections.map(([section, items]) => (
|
||||||
<Accordion key={section} expanded={expanded === section} onChange={(_, isExpanded) => setExpanded(isExpanded ? section : false)}>
|
<Accordion
|
||||||
|
key={section}
|
||||||
|
expanded={expanded === section}
|
||||||
|
onChange={(_, isExpanded) => setExpanded(isExpanded ? section : false)}
|
||||||
|
>
|
||||||
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
||||||
<Typography sx={{ fontWeight: 600 }}>{section}</Typography>
|
<Typography sx={{ fontWeight: 600 }}>{section}</Typography>
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
|
|||||||
Reference in New Issue
Block a user