Commit a5989900 authored by Filipa Lacerda's avatar Filipa Lacerda

Remove service being provided as a prop on environments table

parent 2d6f1e96
<script> <script>
/* eslint-disable no-new */
/* global Flash */ /* global Flash */
import EnvironmentsService from '../services/environments_service'; import EnvironmentsService from '../services/environments_service';
import EnvironmentTable from './environments_table.vue'; import EnvironmentTable from './environments_table.vue';
...@@ -123,6 +121,7 @@ export default { ...@@ -123,6 +121,7 @@ export default {
}) })
.catch(() => { .catch(() => {
this.isLoading = false; this.isLoading = false;
// eslint-disable-next-line no-new
new Flash('An error occurred while fetching the environments.'); new Flash('An error occurred while fetching the environments.');
}); });
}, },
...@@ -138,19 +137,15 @@ export default { ...@@ -138,19 +137,15 @@ export default {
}) })
.catch(() => { .catch(() => {
this.isLoadingFolderContent = false; this.isLoadingFolderContent = false;
// eslint-disable-next-line no-new
new Flash('An error occurred while fetching the environments.'); new Flash('An error occurred while fetching the environments.');
}); });
}, },
postAction(endpoint) { postAction(endpoint) {
this.service.postAction(endpoint) this.service.postAction(endpoint)
.then(() => { .then(() => this.fetchEnvironments())
this.fetchEnvironments(); .catch(() => new Flash('An error occured while making the request.'));
})
.catch(() => {
// eslint-disable-next-line no-new
new Flash('An error occured while making the request.');
});
}, },
}, },
}; };
......
<script> <script>
/* eslint-disable no-new */
/* global Flash */ /* global Flash */
import EnvironmentsService from '../services/environments_service'; import EnvironmentsService from '../services/environments_service';
import EnvironmentTable from '../components/environments_table.vue'; import EnvironmentTable from '../components/environments_table.vue';
...@@ -99,6 +98,7 @@ export default { ...@@ -99,6 +98,7 @@ export default {
}) })
.catch(() => { .catch(() => {
this.isLoading = false; this.isLoading = false;
// eslint-disable-next-line no-new
new Flash('An error occurred while fetching the environments.', 'alert'); new Flash('An error occurred while fetching the environments.', 'alert');
}); });
}, },
...@@ -169,7 +169,7 @@ export default { ...@@ -169,7 +169,7 @@ export default {
:environments="state.environments" :environments="state.environments"
:can-create-deployment="canCreateDeploymentParsed" :can-create-deployment="canCreateDeploymentParsed"
:can-read-environment="canReadEnvironmentParsed" :can-read-environment="canReadEnvironmentParsed"
:service="service"/> />
<table-pagination <table-pagination
v-if="state.paginationInformation && state.paginationInformation.totalPages > 1" v-if="state.paginationInformation && state.paginationInformation.totalPages > 1"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment