adminjs
Version:
Admin panel for apps written in node.js
19 lines (15 loc) • 476 B
text/typescript
import { type NoticeMessage } from '../../interfaces/noticeMessage.interface.js'
import { type NoticeMessageInState } from '../reducers/noticesReducer.js'
export const ADD_NOTICE = 'ADD_NOTICE'
export type AddNoticeResponse = {
type: typeof ADD_NOTICE
data: NoticeMessageInState
}
export const addNotice = (data: NoticeMessage): AddNoticeResponse => ({
type: ADD_NOTICE,
data: {
id: `notice-${Date.now() + Math.random()}`,
progress: 0,
...data,
},
})