34 lines
697 B
TypeScript
34 lines
697 B
TypeScript
import { createSlice } from '@reduxjs/toolkit'
|
|
|
|
export interface ChallengeAction {
|
|
id: number
|
|
challengeId: number
|
|
title: string,
|
|
description: string,
|
|
reward: number,
|
|
success: boolean,
|
|
start: number, // date
|
|
end: number | null, // date
|
|
penaltyStart: number | null, // date
|
|
penaltyEnd: number | null, // date
|
|
}
|
|
|
|
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
|