fx
This commit is contained in:
parent
91b66ed81d
commit
7786904d9d
2 changed files with 0 additions and 44 deletions
|
|
@ -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
|
||||
deletePack: async (packId: string): Promise<{ success: boolean; message: string }> => {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ import { useAuthStore } from '@/stores/authStore'
|
|||
import { Button } from '@/components/ui/button'
|
||||
import {
|
||||
LayoutDashboard,
|
||||
FileText,
|
||||
Package,
|
||||
Users,
|
||||
ClipboardList,
|
||||
LogOut,
|
||||
Menu,
|
||||
X
|
||||
|
|
|
|||
Loading…
Reference in a new issue