import { Injectable } from '@angular/core' ; import { Action } from '@ngrx/store' ; import { SearchCriteria , SearchResults , Question , QuestionStatus } from 'shared-library/shared/model' ; export enum AdminActionTypes { LOAD_QUESTIONS = '[Admin] LoadQuestions' , LOAD_QUESTIONS_SUCCESS = '[Admin] LoadQuestionsSuccess' , LOAD_UNPUBLISHED_QUESTIONS = '[Admin] LoadUnpublishedQuestions' , LOAD_UNPUBLISHED_QUESTIONS_SUCCESS = '[Admin] LoadUnpublishedQuestionsSuccess' , APPROVE_QUESTION = '[Admin] ApproveQuestion' , SAVE_QUESTION_TOGGLE_STATE = '[Admin] SaveQuestionToggleState' , SAVE_ARCHIVE_TOGGLE_STATE = '[Admin] SaveArchiveToggleState' } export class LoadQuestions implements Action { readonly type = AdminActionTypes . LOAD_QUESTIONS ; constructor ( public payload ) { } } export class LoadQuestionsSuccess implements Action { readonly type = AdminActionTypes . LOAD_QUESTIONS_SUCCESS ; constructor ( public payload ) { } } export class LoadUnpublishedQuestions implements Action { readonly type = AdminActionTypes . LOAD_UNPUBLISHED_QUESTIONS ; constructor ( public payload ) { } } export class LoadUnpublishedQuestionsSuccess implements Action { readonly type = AdminActionTypes . LOAD_UNPUBLISHED_QUESTIONS_SUCCESS ; constructor ( public payload ) { } } export class ApproveQuestion implements Action { readonly type = AdminActionTypes . APPROVE_QUESTION ; constructor ( public payload ) { } } export class SaveQuestionToggleState implements Action { readonly type = AdminActionTypes . SAVE_QUESTION_TOGGLE_STATE ; constructor ( public payload ) { } } export class SaveArchiveToggleState implements Action { readonly type = AdminActionTypes . SAVE_ARCHIVE_TOGGLE_STATE ; constructor ( public payload ) { } } export type AdminActions = LoadQuestions | LoadQuestionsSuccess | LoadUnpublishedQuestions | LoadUnpublishedQuestionsSuccess | ApproveQuestion | SaveQuestionToggleState | SaveArchiveToggleState ;