mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2025-12-18 05:09:23 +00:00
lint everything
This commit is contained in:
@@ -1,44 +1,43 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||
|
||||
import { Tab } from '@/services'
|
||||
import { PayloadAction, createSlice } from '@reduxjs/toolkit'
|
||||
|
||||
export const decksSlice = createSlice({
|
||||
name: 'decks',
|
||||
initialState: {
|
||||
currentPage: 1,
|
||||
perPage: 10,
|
||||
search: '',
|
||||
minCards: 0,
|
||||
maxCards: undefined as number | undefined,
|
||||
currentTab: 'all' as Tab,
|
||||
},
|
||||
reducers: {
|
||||
setCurrentPage: (state, action: PayloadAction<number>) => {
|
||||
state.currentPage = action.payload
|
||||
initialState: {
|
||||
currentPage: 1,
|
||||
currentTab: 'all' as Tab,
|
||||
maxCards: undefined as number | undefined,
|
||||
minCards: 0,
|
||||
perPage: 10,
|
||||
search: '',
|
||||
},
|
||||
setPerPage: (state, action: PayloadAction<number>) => {
|
||||
state.perPage = action.payload
|
||||
name: 'decks',
|
||||
reducers: {
|
||||
resetCurrentPage: state => {
|
||||
state.currentPage = 1
|
||||
},
|
||||
resetFilters: state => {
|
||||
state.search = ''
|
||||
state.currentTab = 'all'
|
||||
state.minCards = 0
|
||||
state.maxCards = undefined
|
||||
},
|
||||
setCurrentPage: (state, action: PayloadAction<number>) => {
|
||||
state.currentPage = action.payload
|
||||
},
|
||||
setCurrentTab: (state, action: PayloadAction<Tab>) => {
|
||||
state.currentTab = action.payload
|
||||
},
|
||||
setMaxCards: (state, action: PayloadAction<number>) => {
|
||||
state.maxCards = action.payload
|
||||
},
|
||||
setMinCards: (state, action: PayloadAction<number>) => {
|
||||
state.minCards = action.payload
|
||||
},
|
||||
setPerPage: (state, action: PayloadAction<number>) => {
|
||||
state.perPage = action.payload
|
||||
},
|
||||
setSearch: (state, action: PayloadAction<string>) => {
|
||||
state.search = action.payload
|
||||
},
|
||||
},
|
||||
setSearch: (state, action: PayloadAction<string>) => {
|
||||
state.search = action.payload
|
||||
},
|
||||
setCurrentTab: (state, action: PayloadAction<Tab>) => {
|
||||
state.currentTab = action.payload
|
||||
},
|
||||
setMinCards: (state, action: PayloadAction<number>) => {
|
||||
state.minCards = action.payload
|
||||
},
|
||||
setMaxCards: (state, action: PayloadAction<number>) => {
|
||||
state.maxCards = action.payload
|
||||
},
|
||||
resetFilters: state => {
|
||||
state.search = ''
|
||||
state.currentTab = 'all'
|
||||
state.minCards = 0
|
||||
state.maxCards = undefined
|
||||
},
|
||||
resetCurrentPage: state => {
|
||||
state.currentPage = 1
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user