Deck szerkesztese
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user