From 6f0a3690383b7ddf8e6cc7b971470e1812306e2c Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 9 Apr 2019 02:44:24 +0100 Subject: [PATCH] Add getVersion method --- src/api-client.js | 4 ++++ src/components/Application/PhpVersion.vue | 2 +- src/views/Environment.vue | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api-client.js b/src/api-client.js index 2a22649..d9a67a1 100644 --- a/src/api-client.js +++ b/src/api-client.js @@ -271,6 +271,10 @@ export default { getApplicationType (application) { return this.getTypes()[application.type] + }, + + getVersion (type, environment) { + return _(environment).get(`versions.${type}`) } } } diff --git a/src/components/Application/PhpVersion.vue b/src/components/Application/PhpVersion.vue index cebb486..b4be033 100644 --- a/src/components/Application/PhpVersion.vue +++ b/src/components/Application/PhpVersion.vue @@ -22,7 +22,7 @@ export default { return null } - return _.get(this.getEnvironment(this.application.id, 'prod'), 'versions.php') + return this.getVersion('php', this.getEnvironment(this.application.id, 'prod')) } } } diff --git a/src/views/Environment.vue b/src/views/Environment.vue index 9a13cc7..6d58cfc 100644 --- a/src/views/Environment.vue +++ b/src/views/Environment.vue @@ -171,7 +171,7 @@ export default { }, phpVersion: function () { - return _(this.environment).get('versions.php') + return this.getVersion('php', this.environment) } } }