Skip to content

Commit

Permalink
Merge pull request #3153 from CVEProject/tat-3152-axios
Browse files Browse the repository at this point in the history
#3152 use full url for axios calls and fix lint warning
  • Loading branch information
david-rocca authored Oct 11, 2024
2 parents 960531c + 1e19485 commit d13467b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
11 changes: 2 additions & 9 deletions src/stores/cveListSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,11 @@ export const useCveListSearchStore = defineStore('cveListSearch ', {
},
async getSearchResults() {
this.isQueryingSearchService = true;

const instance = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL,
});
const searchUrl = `${import.meta.env.VITE_API_BASE_URL}${import.meta.env.VITE_LIST_SEARCH_PATH}`;

try {
let payLoad = this.createSearchPayload();
const response = await instance.post(
import.meta.env.VITE_LIST_SEARCH_PATH,
payLoad
);

const response = await axios.post(searchUrl, payLoad);

if (response.status === 200) {
this.totalSearchResultCount = response.data.resultsTotal;
Expand Down
6 changes: 1 addition & 5 deletions src/views/Media/News/NewsletterSignup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,7 @@ export default {
this.isLoading = true;
this.subscribed = false;
const instance = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL,
});
instance.post('restapi/newsletter', this.userInfo)
axios.post(`${import.meta.env.VITE_API_BASE_URL}restapi/newsletter`, this.userInfo)
.then((res) => {
if (res.status === 200) {
this.subscribed = true;
Expand Down
5 changes: 1 addition & 4 deletions src/views/ReportRequest/ReportRequestForNonCNAs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@
import NavigationSidebar from '@/components/NavigationSidebar.vue';
import SurveyLinkComponent from '@/components/SurveyLinkComponent.vue';
import data from '@/assets/data/CNAsList.json';
import ServiceUnavailable from '@/components/ServiceUnavailable.vue';
export default {
name: 'ReportRequestForNonCNAs',
Expand All @@ -175,9 +174,7 @@ export default {
},
components: {
NavigationSidebar,
SurveyLinkComponent,
// NOTE(drocca): This was throwing a linting error, however, this is not something I touched. It was being flagged for being registered and not being used.
//ServiceUnavailable
SurveyLinkComponent
},
data() {
return {
Expand Down

0 comments on commit d13467b

Please sign in to comment.