Skip to content

Commit

Permalink
Merge branch 'main' into cdc-heartbeats
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal authored Oct 25, 2023
2 parents c61bcdd + 0a30091 commit 0d4fd14
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 8 additions & 2 deletions ui/app/api/peers/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
ValidatePeerRequest,
ValidatePeerResponse,
ValidatePeerStatus,
createPeerStatusFromJSON,
validatePeerStatusFromJSON,
} from '@/grpc_generated/route';
import { GetFlowHttpAddressFromEnv } from '@/rpc/http';

Expand Down Expand Up @@ -65,7 +67,9 @@ export async function POST(request: Request) {
return res.json();
});
let response: UValidatePeerResponse = {
valid: validateStatus.status === ValidatePeerStatus.VALID,
valid:
validatePeerStatusFromJSON(validateStatus.status) ===
ValidatePeerStatus.VALID,
message: validateStatus.message,
};
return new Response(JSON.stringify(response));
Expand All @@ -81,7 +85,9 @@ export async function POST(request: Request) {
return res.json();
});
let response: UCreatePeerResponse = {
created: createStatus.status === CreatePeerStatus.CREATED,
created:
createPeerStatusFromJSON(createStatus.status) ===
CreatePeerStatus.CREATED,
message: createStatus.message,
};
return new Response(JSON.stringify(response));
Expand Down
3 changes: 1 addition & 2 deletions ui/app/peers/create/[peerType]/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ export const handleValidate = async (
setMessage({ ok: false, msg: valid.message });
setLoading(false);
return;
} else {
setMessage({ ok: true, msg: 'Peer is valid' });
}
setMessage({ ok: true, msg: 'Peer is valid' });
setLoading(false);
};

Expand Down
2 changes: 1 addition & 1 deletion ui/app/peers/create/[peerType]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default function CreateConfig({
{!loading && formMessage.msg.length > 0 && (
<Label
colorName='lowContrast'
colorSet={formMessage.ok ? 'positive' : 'destructive'}
colorSet={formMessage.ok === true ? 'positive' : 'destructive'}
variant='subheadline'
>
{formMessage.msg}
Expand Down

0 comments on commit 0d4fd14

Please sign in to comment.