update
This commit is contained in:
1 parent
7a3db27ffa
commit
1ba3147ed2
96 files changed
+9400
-6269
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
IPC_CHANNELS,
|
||||
bootstrapOnboardingSchema,
|
||||
} from "@shared/contracts";
|
||||
import { fail, ok, type RegisterDomainHandlersDependencies } from "./ipc-domain-common";
|
||||
|
||||
export function registerOnboardingHandlers({
|
||||
registerHandle,
|
||||
bootstrapOnboarding,
|
||||
}: Pick<
|
||||
RegisterDomainHandlersDependencies,
|
||||
"registerHandle" | "bootstrapOnboarding"
|
||||
>) {
|
||||
registerHandle(IPC_CHANNELS.bootstrapOnboarding, (_event, payload) => {
|
||||
const input = bootstrapOnboardingSchema.parse(payload);
|
||||
try {
|
||||
return ok(bootstrapOnboarding(input));
|
||||
} catch (error) {
|
||||
return fail("ONBOARDING_BOOTSTRAP_FAILED", error instanceof Error ? error.message : "Unable to bootstrap onboarding.");
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user