diff options
author | Phil Hughes <me@iamphill.com> | 2017-04-28 17:06:19 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-04-28 17:06:19 +0100 |
commit | e11a702afceee7f5edeb8c93a4192fa05209b091 (patch) | |
tree | ecb9cea80803638c9b8878b091793beb3ed88720 /app/assets/javascripts/deploy_keys/store/index.js | |
parent | 79e2a524e22e5474c5b33deb81ac6cc51512d2e5 (diff) | |
download | gitlab-ce-e11a702afceee7f5edeb8c93a4192fa05209b091.tar.gz |
Re-wrote to match our docs - still not 100% sure but closer than it was
Diffstat (limited to 'app/assets/javascripts/deploy_keys/store/index.js')
-rw-r--r-- | app/assets/javascripts/deploy_keys/store/index.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/assets/javascripts/deploy_keys/store/index.js b/app/assets/javascripts/deploy_keys/store/index.js new file mode 100644 index 00000000000..7177d9bed7f --- /dev/null +++ b/app/assets/javascripts/deploy_keys/store/index.js @@ -0,0 +1,13 @@ +export default class DeployKeysStore { + constructor() { + this.keys = {}; + } + + findEnabledKey(id) { + return this.keys.enabled_keys.find(key => key.id === id); + } + + removeKeyForType(deployKey, type) { + this.keys[type] = this.keys[type].filter(key => key.id !== deployKey.id); + } +} |