Add custom project.toJSON to simplify state mangement

This commit is contained in:
Nick O'Leary
2017-10-17 10:14:50 +01:00
parent 4569cb432d
commit 5218a3fbac
5 changed files with 70 additions and 46 deletions

View File

@@ -189,7 +189,7 @@ var api = module.exports = {
if (projectKey) {
// This is a project with a bad key. Mark it as invalid
// TODO: this delves too deep into Project structure
activeProject.info.settings.credentialSecretInvalid = true;
activeProject.credentialSecretInvalid = true;
return when.reject(error);
}
return when.reject(error);
@@ -198,7 +198,8 @@ var api = module.exports = {
credentialCache = credentials;
}
if (clearInvalidFlag) {
delete activeProject.info.settings.credentialSecretInvalid;
// TODO: this delves too deep into Project structure
delete activeProject.credentialSecretInvalid;
}
});
},