I have the following code and I would like to refactor it by using a dictionary or something like that, to reduce the code complexity. It is possible there can be any number of case statements.
switch (this.errorType) {
case ErrorType.NoApps:
this.title = 'No Apps Found';
this.subtitle = 'Contact applications team';
this.message = 'no apps message';
this.contact = 'John';
break;
case ErrorType.NoAccounts:
this.title = 'No Accounts Found';
this.subtitle = 'Contact Support Team';
this.message = 'no accounts message';
this.contact = 'Jake';
break;
case ErrorType.NoUsers:
this.title = 'No users Found';
this.subtitle = 'Contact customer service';
this.message = 'no accounts message';
this.contact = 'Wiley';
break;
}