mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-16 21:11:16 +00:00
15 lines
No EOL
328 B
JavaScript
15 lines
No EOL
328 B
JavaScript
import axios from 'axios';
|
|
import config from '@/config';
|
|
|
|
export const instance = () => {
|
|
return axios.create({
|
|
baseURL: config.domain,
|
|
withCredentials: true
|
|
})
|
|
}
|
|
|
|
export const wrapper = (promise) => {
|
|
return promise
|
|
.then(result => ({ok: true, result}))
|
|
.catch(error => Promise.resolve({ok: false, error}))
|
|
} |