Deck szerkesztese

This commit is contained in:
2025-10-24 20:34:43 +02:00
parent 8960bd9dce
commit cea9062f91
4 changed files with 223 additions and 67 deletions
+24 -2
View File
@@ -20,6 +20,28 @@ export const getDecksPage = async (from = 0, to = 49) => {
}
}
export default {
createDeck
// Get a specific deck by ID (authenticated)
export const getDeckById = async (deckId) => {
try {
const response = await apiClient.get(`/decks/${deckId}`)
return response.data
} catch (err) {
throw err
}
}
// Update an existing deck (authenticated)
export const updateDeck = async (deckId, deck) => {
try {
const response = await apiClient.patch(`/decks/${deckId}`, deck)
return response.data
} catch (err) {
throw err
}
}
export default {
createDeck,
getDeckById,
updateDeck
}