diff options
author | Phil Hughes <me@iamphill.com> | 2018-06-28 15:09:21 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-06-29 09:29:30 +0100 |
commit | fa8c82c7ec6bb380c1b90421e99b6e8cdee3d790 (patch) | |
tree | bdab6fcfd87a27f5ca475ff0dd6f5a2f28244724 /app/assets/javascripts/ide/stores | |
parent | d255fd4f4650107cef5326db72064588eabc4557 (diff) | |
download | gitlab-ce-fa8c82c7ec6bb380c1b90421e99b6e8cdee3d790.tar.gz |
:white_check_mark: added specs for file actions
in this it also removes Vue Resource from the IDE, axios is nicer to test
Diffstat (limited to 'app/assets/javascripts/ide/stores')
-rw-r--r-- | app/assets/javascripts/ide/stores/actions/file.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js index 9fb964e299b..1111a14a7d7 100644 --- a/app/assets/javascripts/ide/stores/actions/file.js +++ b/app/assets/javascripts/ide/stores/actions/file.js @@ -66,13 +66,9 @@ export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive .getFileData( `${gon.relative_url_root ? gon.relative_url_root : ''}${file.url.replace('/-/', '/')}`, ) - .then(res => { - const pageTitle = decodeURI(normalizeHeaders(res.headers)['PAGE-TITLE']); - setPageTitle(pageTitle); + .then(({ data, headers }) => { + setPageTitle(decodeURI(headers['page-title'])); - return res.json(); - }) - .then(data => { commit(types.SET_FILE_DATA, { data, file }); commit(types.TOGGLE_FILE_OPEN, path); if (makeFileActive) dispatch('setFileActive', path); |