domain_health_status
This commit is contained in:
@@ -102,3 +102,19 @@ export const billingAPI = {
|
||||
return (await api.get(`/api/billing/events${qs ? '?' + qs : ''}`)).data;
|
||||
},
|
||||
};
|
||||
|
||||
export const healthAPI = {
|
||||
// Read the last persisted status (cheap; used by the banner).
|
||||
// Returns null if the domain has never been checked.
|
||||
getStatus: async (domain) => {
|
||||
try {
|
||||
return (await api.get(`/api/health/domains/${encodeURIComponent(domain)}`)).data;
|
||||
} catch (err) {
|
||||
if (err.statusCode === 404) return null;
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
// Run all checks now and return the full report.
|
||||
runCheck: async (domain) =>
|
||||
(await api.post(`/api/health/domains/${encodeURIComponent(domain)}/check`)).data,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user