fix(ui): use public healthstatus route
This commit is contained in:
parent
fffe458a76
commit
2a9d7cefec
3 changed files with 5 additions and 5 deletions
|
|
@ -26,8 +26,8 @@ function mapResponse(resp: Record<string, any>) {
|
|||
return { overallHealth, healthMap };
|
||||
}
|
||||
|
||||
export async function getHealthRequest() {
|
||||
const r = await healthService.fetchStatus();
|
||||
export async function getHealthRequest(isPublic?: boolean) {
|
||||
const r = await healthService.fetchStatus(isPublic);
|
||||
const healthMap = mapResponse(r);
|
||||
const asked = new Date().getTime();
|
||||
localStorage.setItem(healthResponseKey, JSON.stringify(healthMap));
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export default class Signup extends React.Component {
|
|||
|
||||
getHealth = async () => {
|
||||
this.setState({ healthStatusLoading: true });
|
||||
const { healthMap } = await getHealthRequest();
|
||||
const { healthMap } = await getHealthRequest(true);
|
||||
this.setState({ healthStatus: healthMap, healthStatusLoading: false });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import BaseService from './BaseService';
|
||||
|
||||
export default class HealthService extends BaseService {
|
||||
fetchStatus(): Promise<any> {
|
||||
return this.client.get('/health')
|
||||
fetchStatus(isPublic?: boolean): Promise<any> {
|
||||
return this.client.get(isPublic ? '/health' : '/healthz')
|
||||
.then(r => r.json())
|
||||
.then(j => j.data || {})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue