import { Observable } from 'rxjs' ; import { BulkActions , BulkActionTypes } from '../actions' ; import { BulkUploadFileInfo , Question , User } from 'shared-library/shared/model' ; import { UserActions } from 'shared-library/core/store' ; export function bulkUploadFileInfos ( state = [ ] , action ) { switch ( action . type ) { case BulkActionTypes . LOAD_BULK_UPLOAD_SUCCESS : return action . payload ; default : return state ; } } export function userBulkUploadFileInfos ( state = [ ] , action ) { switch ( action . type ) { case BulkActionTypes . LOAD_USER_BULK_UPLOAD_SUCCESS : return action . payload ; default : return state ; } } export function bulkUploadPublishedQuestions ( state = [ ] , action ) { switch ( action . type ) { case BulkActionTypes . LOAD_BULK_UPLOAD_PUBLISHED_QUESTIONS_SUCCESS : return action . payload ; default : return state ; } } export function bulkUploadUnpublishedQuestions ( state = [ ] , action ) { switch ( action . type ) { case BulkActionTypes . LOAD_BULK_UPLOAD_UNPUBLISHED_QUESTIONS_SUCCESS : return action . payload ; default : return state ; } } export function bulkUploadFileUrl ( state , action ) { switch ( action . type ) { case BulkActionTypes . LOAD_BULK_UPLOAD_FILE_URL_SUCCESS : return action . payload ; default : return null ; } } export function bulkUploadArchiveStatus ( state = 'NONE' , action ) { switch ( action . type ) { case BulkActionTypes . ARCHIVE_BULK_UPLOAD_SUCCESS : return 'ARCHIVED' ; default : return null ; } } export function bulkUploadFileInfo ( state , action ) { switch ( action . type ) { case BulkActionTypes . LOAD_BULK_UPLOAD_FILE_SUCCESS : return action . payload ; default : return state ; } } export function getArchiveToggleState ( state = null , action ) { switch ( action . type ) { case BulkActionTypes . SAVE_ARCHIVE_TOGGLE_STATE : return action . payload . toggle_state ; default : return state ; } } export function getArchiveList ( state = [ ] , action ) { switch ( action . type ) { case BulkActionTypes . SAVE_ARCHIVE_LIST : return [ ... action . payload ] ; default : return state ; } }