Revert "v0.2.1 (#157)" (#158)

This reverts commit a899f46464.
This commit is contained in:
Hayden 2021-02-10 19:39:46 -09:00 committed by GitHub
parent a899f46464
commit 8221c36a89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 895 additions and 937 deletions

View file

@ -1,20 +1,23 @@
const baseURL = "/api/";
import axios from "axios";
import utils from "@/utils";
import store from "../store/store";
// look for data.snackbar in response
function processResponse(response) {
try {
utils.notify.show(response.data.snackbar.text, response.data.snackbar.type);
store.commit("setSnackBar", {
text: response.data.snackbar.text,
type: response.data.snackbar.type,
});
} catch (err) {
return;
}
return;
}
const apiReq = {
post: async function(url, data) {
let response = await axios.post(url, data).catch(function(error) {
post: async function (url, data) {
let response = await axios.post(url, data).catch(function (error) {
if (error.response) {
processResponse(error.response);
return error.response;
@ -24,19 +27,8 @@ const apiReq = {
return response;
},
put: async function(url, data) {
let response = await axios.put(url, data).catch(function(error) {
if (error.response) {
processResponse(error.response);
return response;
} else return;
});
processResponse(response);
return response;
},
get: async function(url, data) {
let response = await axios.get(url, data).catch(function(error) {
put: async function (url, data) {
let response = await axios.put(url, data).catch(function (error) {
if (error.response) {
processResponse(error.response);
return response;
@ -46,8 +38,19 @@ const apiReq = {
return response;
},
delete: async function(url, data) {
let response = await axios.delete(url, data).catch(function(error) {
get: async function (url, data) {
let response = await axios.get(url, data).catch(function (error) {
if (error.response) {
processResponse(error.response);
return response;
} else return;
});
// processResponse(response);
return response;
},
delete: async function (url, data) {
let response = await axios.delete(url, data).catch(function (error) {
if (error.response) {
processResponse(error.response);
return response;