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
|
// Delete pack
|
||||||
deletePack: async (packId: string): Promise<{ success: boolean; message: string }> => {
|
deletePack: async (packId: string): Promise<{ success: boolean; message: string }> => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue