34 lines
653 B
TypeScript
34 lines
653 B
TypeScript
|
import { createSlice } from '@reduxjs/toolkit'
|
||
|
|
||
|
export interface ChallengeAction {
|
||
|
id: number
|
||
|
challengeId: number
|
||
|
title: string,
|
||
|
description: string,
|
||
|
reward: number,
|
||
|
success: boolean,
|
||
|
start: Date,
|
||
|
end: Date | null,
|
||
|
penaltyStart: Date | null,
|
||
|
penaltyEnd: Date | null,
|
||
|
}
|
||
|
|
||
|
export interface ActionsState {
|
||
|
challengeActions: ChallengeAction[]
|
||
|
}
|
||
|
|
||
|
const initialState: ActionsState = {
|
||
|
challengeActions: []
|
||
|
}
|
||
|
|
||
|
export const challengeActionsSlice = createSlice({
|
||
|
name: 'challengeActions',
|
||
|
initialState: initialState,
|
||
|
reducers: {
|
||
|
},
|
||
|
})
|
||
|
|
||
|
export const { } = challengeActionsSlice.actions
|
||
|
|
||
|
export default challengeActionsSlice.reducer
|