Move contact page to its own route handler
This commit is contained in:
parent
88236e036c
commit
13d4a49976
5 changed files with 62 additions and 30 deletions
27
src/configuration/webconfig.js
Normal file
27
src/configuration/webconfig.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import clone from 'clone';
|
||||
|
||||
export default class WebConfiguration {
|
||||
constructor(config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
getEmailContacts() {
|
||||
return clone(this.config.contacts);
|
||||
}
|
||||
}
|
||||
|
||||
WebConfiguration.fromOldConfig = function (oldConfig) {
|
||||
const config = {
|
||||
contacts: []
|
||||
};
|
||||
|
||||
oldConfig.get('contacts').forEach(contact => {
|
||||
config.contacts.push({
|
||||
name: contact.name,
|
||||
email: contact.email,
|
||||
title: contact.title
|
||||
});
|
||||
});
|
||||
|
||||
return new WebConfiguration(config);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue