mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2026-01-05 20:52:05 +00:00
add modals
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import { CardsResponse, DeckResponse, DecksResponse } from './decks.types'
|
||||
import { CardsResponse, DeckResponse, DecksResponse, GetDecksArgs } from './decks.types'
|
||||
|
||||
import { baseApi } from '@/services'
|
||||
|
||||
const decksService = baseApi.injectEndpoints({
|
||||
endpoints: builder => ({
|
||||
getDecks: builder.query<DecksResponse, void>({
|
||||
query: () => `v1/decks`,
|
||||
getDecks: builder.query<DecksResponse, GetDecksArgs | void>({
|
||||
query: args => {
|
||||
return {
|
||||
url: `v1/decks`,
|
||||
params: args ?? undefined,
|
||||
}
|
||||
},
|
||||
}),
|
||||
getDeckById: builder.query<DeckResponse, { id: string }>({
|
||||
query: ({ id }) => `v1/decks/${id}`,
|
||||
|
||||
Reference in New Issue
Block a user