This commit is contained in:
Ben Irvin 2022-12-27 11:12:34 +01:00
parent 4190687975
commit 777f76a0df
2 changed files with 4 additions and 4 deletions

View File

@ -179,7 +179,7 @@ const createTransferController =
const payload = JSON.stringify({
uuid,
data: data ?? {},
error: e,
error: JSON.stringify(e?.message),
});
ws.send(payload, (error) => (error ? reject(error) : resolve()));
@ -210,7 +210,7 @@ const createTransferController =
};
const init = (msg: InitMessage) => {
const { kind, options: controllerOptions } = msg;
const { kind, data: controllerOptions } = msg;
if (state.controller) {
throw new Error('Transfer already in progres');

View File

@ -28,8 +28,8 @@ export type PushTransferStage = PushTransferMessage['stage'];
// init should return a transfer ID used in the teardown
export type InitMessage = { type: 'init' } & (
| { kind: 'pull'; options: EmptyObject }
| { kind: 'push'; options: Pick<ILocalStrapiDestinationProviderOptions, 'strategy' | 'restore'> }
| { kind: 'pull'; data: EmptyObject }
| { kind: 'push'; data: Pick<ILocalStrapiDestinationProviderOptions, 'strategy' | 'restore'> }
);
/**