new features
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import axios from 'axios';
|
||||
|
||||
// Same-origin: backend serves the built frontend, vite dev proxies /api.
|
||||
const api = axios.create({
|
||||
baseURL: '/',
|
||||
withCredentials: true,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
|
||||
// Centralized error normalization so callers always see err.message + err.statusCode.
|
||||
api.interceptors.response.use(
|
||||
(r) => r,
|
||||
(err) => {
|
||||
@@ -52,6 +50,12 @@ export const mailboxesAPI = {
|
||||
`/api/mailboxes/${encodeURIComponent(email)}/password`,
|
||||
{ password }
|
||||
)).data,
|
||||
// quota_gb: integer, e.g. 5, 10, 15...
|
||||
setQuota: async (email, quota_gb) =>
|
||||
(await api.post(
|
||||
`/api/mailboxes/${encodeURIComponent(email)}/quota`,
|
||||
{ quota_gb }
|
||||
)).data,
|
||||
getRules: async (email) =>
|
||||
(await api.get(`/api/mailboxes/${encodeURIComponent(email)}/rules`)).data,
|
||||
putRules: async (email, payload) =>
|
||||
|
||||
Reference in New Issue
Block a user