Categories select + modal
This commit is contained in:
parent
aaedcec4a6
commit
0999ef563a
6 changed files with 210 additions and 40 deletions
|
@ -14,10 +14,16 @@ export class Request {
|
|||
* @returns {Promise<AxiosResponse<any>>}
|
||||
*/
|
||||
static get(url: string, headers = {}) {
|
||||
return axios.get(API_URL + url, {
|
||||
...CONFIG,
|
||||
...headers,
|
||||
});
|
||||
return axios
|
||||
.get(API_URL + url, {
|
||||
...CONFIG,
|
||||
...headers,
|
||||
})
|
||||
.then(response => response.data)
|
||||
.catch(error => {
|
||||
// Handle error
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,10 +35,16 @@ export class Request {
|
|||
* @returns {Promise<AxiosResponse<any>>}
|
||||
*/
|
||||
static post(url: string, body = {}, headers = {}) {
|
||||
return axios.post(API_URL + url, body, {
|
||||
...CONFIG,
|
||||
...headers,
|
||||
});
|
||||
return axios
|
||||
.post(API_URL + url, body, {
|
||||
...CONFIG,
|
||||
...headers,
|
||||
})
|
||||
.then(response => response.data)
|
||||
.catch(error => {
|
||||
// Handle error
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,10 +56,16 @@ export class Request {
|
|||
* @returns {Promise<AxiosResponse<any>>}
|
||||
*/
|
||||
static put(url: string, body = {}, headers = {}) {
|
||||
return axios.put(API_URL + url, body, {
|
||||
...CONFIG,
|
||||
...headers,
|
||||
});
|
||||
return axios
|
||||
.put(API_URL + url, body, {
|
||||
...CONFIG,
|
||||
...headers,
|
||||
})
|
||||
.then(response => response.data)
|
||||
.catch(error => {
|
||||
// Handle error
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue