Please sync invitatinos
This commit is contained in:
@@ -196,6 +196,8 @@ export function InvitationScreen(): React.ReactElement {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Importing invitation:', invitationId);
|
||||
|
||||
try {
|
||||
setIsLoading(true);
|
||||
setStatus('Fetching invitation...');
|
||||
|
||||
@@ -323,6 +323,8 @@ export function useActionWizard() {
|
||||
actionIdentifier,
|
||||
});
|
||||
|
||||
console.log(xoInvitation)
|
||||
|
||||
// Wrap and track
|
||||
const invitationInstance =
|
||||
await appService.createInvitation(xoInvitation);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { XOInvitation } from "@xo-cash/types";
|
||||
import { EventEmitter } from "./event-emitter.js";
|
||||
import { SSESession, type SSEvent } from "./sse-client.js";
|
||||
import { decodeExtendedJsonObject, encodeExtendedJson } from "./ext-json.js";
|
||||
import { decodeExtendedJson, decodeExtendedJsonObject, encodeExtendedJson, encodeExtendedJsonObject } from "./ext-json.js";
|
||||
|
||||
export type SyncServerEventMap = {
|
||||
'connected': void;
|
||||
@@ -66,7 +66,7 @@ export class SyncServer extends EventEmitter<SyncServerEventMap> {
|
||||
throw new Error(`Failed to get invitation: ${response.statusText}`);
|
||||
}
|
||||
|
||||
const invitation = decodeExtendedJsonObject(await response.text()) as XOInvitation | undefined;
|
||||
const invitation = decodeExtendedJson(await response.text()) as XOInvitation | undefined;
|
||||
return invitation;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export class SyncServer extends EventEmitter<SyncServerEventMap> {
|
||||
|
||||
// Read the returned JSON
|
||||
// TODO: This should use zod to verify the response
|
||||
const data = decodeExtendedJsonObject(await response.text()) as XOInvitation;
|
||||
const data = decodeExtendedJson(await response.text()) as XOInvitation;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user