import { UploadTaskSnapshot } from '@angular/fire/storage/interfaces' ; import { AchievementRule , Subscribers , Question } from 'shared-library/shared/model' ; import { DashboardActions , DashboardActionTypes } from '../actions' ; export function subscriptionSaveStatus ( state = 'NONE' , action ) { switch ( action . type ) { case DashboardActionTypes . ADD_SUBSCRIBER : return 'IN PROCESS' ; case DashboardActionTypes . ADD_SUBSCRIBER_SUCCESS : return 'SUCCESS' ; case DashboardActionTypes . ADD_SUBSCRIBER_ERROR : return action . payload ; default : return state ; } } export function getTotalSubscriptionStatus ( state = [ ] , action ) { switch ( action . type ) { case DashboardActionTypes . TOTAL_SUBSCRIBER_SUCCESS : return action . payload ; default : return state ; } } export function subscriptionRemoveStatus ( state = 'NONE' , action ) { switch ( action . type ) { case DashboardActionTypes . REMOVE_SUBSCRIBER : return 'IN PROCESS' ; case DashboardActionTypes . REMOVE_SUBSCRIBER_SUCCESS : return 'SUCCESS' ; default : return state ; } } export function checkEmailSubscriptionStatus ( state = [ ] , action ) { switch ( action . type ) { case DashboardActionTypes . CHECK_SUBSCRIPTION : return action . payload ; default : return state ; } } export function socialShareImageUrl ( state = null , action ) { switch ( action . type ) { case DashboardActionTypes . LOAD_SOCIAL_SCORE_SHARE_URL_SUCCESS : return action . payload ; default : return state ; } } export function blogs ( state = null , action ) { switch ( action . type ) { case DashboardActionTypes . LOAD_BLOGS_SUCCESS : return action . payload ; default : return state ; } } export function scoreBoard ( state = null , action ) { switch ( action . type ) { case DashboardActionTypes . LOAD_LEADERBOARD_SUCCESS : return action . payload ; default : return state ; } } export function systemStat ( state = null , action ) { switch ( action . type ) { case DashboardActionTypes . LOAD_SYSTEM_STAT_SUCCESS : return action . payload ; case DashboardActionTypes . LOAD_SYSTEM_STAT_ERROR : return action . payload ; default : return state ; } } export function achievements ( state = null , action ) { switch ( action . type ) { case DashboardActionTypes . LOAD_ACHIEVEMENTS_SUCCESS : return action . payload ; default : return state ; } } export function userLatestPublishedQuestion ( state = [ ] , action ) { switch ( action . type ) { case DashboardActionTypes . LOAD_USER_LATEST_PUBLISHED_QUESTION_SUCCESS : return action . payload ; default : return state ; } }