Move API_ORIGIN into constants.js
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
import { API_ORIGIN } from '../constants.js';
|
||||
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async list(domain, search = '') {
|
||||
let result;
|
||||
try {
|
||||
result = await fetcher.get(`${origin}/api/v1/mail/${domain}/mailboxes`, { page: 1, per_page: 1000, access_token: accessToken });
|
||||
result = await fetcher.get(`${API_ORIGIN}/api/v1/mail/${domain}/mailboxes`, { page: 1, per_page: 1000, access_token: accessToken });
|
||||
} catch (e) {
|
||||
return [e];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user