mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2026-01-29 05:12:08 +00:00
add cards table and pagination
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { DecksResponse } from './decks.types'
|
||||
import { CardsResponse, DeckResponse, DecksResponse } from './decks.types'
|
||||
|
||||
import { baseApi } from '@/services'
|
||||
|
||||
@@ -7,7 +7,13 @@ const decksService = baseApi.injectEndpoints({
|
||||
getDecks: builder.query<DecksResponse, void>({
|
||||
query: () => `v1/decks`,
|
||||
}),
|
||||
getDeckById: builder.query<DeckResponse, { id: string }>({
|
||||
query: ({ id }) => `v1/decks/${id}`,
|
||||
}),
|
||||
getDeckCards: builder.query<CardsResponse, { id: string }>({
|
||||
query: ({ id }) => `v1/decks/${id}/cards`,
|
||||
}),
|
||||
}),
|
||||
})
|
||||
|
||||
export const { useGetDecksQuery } = decksService
|
||||
export const { useGetDecksQuery, useGetDeckByIdQuery, useGetDeckCardsQuery } = decksService
|
||||
|
||||
Reference in New Issue
Block a user