mirror of
https://github.com/wassname/talk.git
synced 2026-06-27 19:33:06 +08:00
@@ -2,6 +2,7 @@ import { Environment } from "relay-runtime";
|
||||
|
||||
import { CoralContext } from "coral-framework/lib/bootstrap";
|
||||
import { createMutationContainer } from "coral-framework/lib/relay";
|
||||
import { SetAccessTokenMutation } from "coral-framework/mutations";
|
||||
import { install, InstallInput } from "coral-framework/rest";
|
||||
|
||||
export type InstallMutation = (input: InstallInput) => Promise<void>;
|
||||
@@ -9,9 +10,10 @@ export type InstallMutation = (input: InstallInput) => Promise<void>;
|
||||
export async function commit(
|
||||
environment: Environment,
|
||||
input: InstallInput,
|
||||
{ rest }: CoralContext
|
||||
ctx: CoralContext
|
||||
) {
|
||||
await install(rest, input);
|
||||
await install(ctx.rest, input);
|
||||
await SetAccessTokenMutation.commit(environment, { accessToken: "" }, ctx);
|
||||
}
|
||||
|
||||
export const withInstallMutation = createMutationContainer("install", commit);
|
||||
|
||||
Reference in New Issue
Block a user