This commit is contained in:
Dmitry 2026-01-07 00:28:41 +03:00
parent 91b66ed81d
commit 7786904d9d
2 changed files with 0 additions and 44 deletions

View file

@ -143,48 +143,6 @@ export const packsApi = {
} }
}, },
// Link a test to a pack (requires sending pack title due to backend validation)
linkTestToPack: async (
packId: string,
testId: string,
): Promise<{ success: boolean; pack: EditCardPackDto }> => {
const pack = await packsApi.getPack(packId)
const title = pack.title?.trim()
if (!title) {
throw createPacksApiError(
`Pack "${packId}" has no title; cannot link test`,
400,
'title',
)
}
return packsApi.upsertPack({
id: packId,
title,
addTestIds: [testId],
})
},
// Unlink a test from a pack (requires sending pack title due to backend validation)
unlinkTestFromPack: async (
packId: string,
testId: string,
): Promise<{ success: boolean; pack: EditCardPackDto }> => {
const pack = await packsApi.getPack(packId)
const title = pack.title?.trim()
if (!title) {
throw createPacksApiError(
`Pack "${packId}" has no title; cannot unlink test`,
400,
'title',
)
}
return packsApi.upsertPack({
id: packId,
title,
removeTestIds: [testId],
})
},
// Delete pack // Delete pack
deletePack: async (packId: string): Promise<{ success: boolean; message: string }> => { deletePack: async (packId: string): Promise<{ success: boolean; message: string }> => {
try { try {

View file

@ -4,10 +4,8 @@ import { useAuthStore } from '@/stores/authStore'
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
import { import {
LayoutDashboard, LayoutDashboard,
FileText,
Package, Package,
Users, Users,
ClipboardList,
LogOut, LogOut,
Menu, Menu,
X X