mirror of
https://github.com/wassname/talk.git
synced 2026-07-14 11:18:50 +08:00
37959f9398
* feat: support blue color in message * feat: Show message when comment is in review * feat: handle non-visible comment status * test: add feature test for handling invisible comment status * fix: apply review * chore: better comment :-) * Update isVisible.ts
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
import { graphql } from "react-relay";
|
|
import { Environment } from "relay-runtime";
|
|
|
|
import {
|
|
commitMutationPromiseNormalized,
|
|
createMutationContainer,
|
|
MutationInput,
|
|
MutationResponsePromise,
|
|
} from "talk-framework/lib/relay";
|
|
|
|
import { UpdateSettingsMutation as MutationTypes } from "talk-admin/__generated__/UpdateSettingsMutation.graphql";
|
|
|
|
export type UpdateSettingsInput = MutationInput<MutationTypes>;
|
|
|
|
const mutation = graphql`
|
|
mutation UpdateSettingsMutation($input: UpdateSettingsInput!) {
|
|
updateSettings(input: $input) {
|
|
settings {
|
|
auth {
|
|
...AuthConfigContainer_auth
|
|
}
|
|
...ModerationConfigContainer_settings
|
|
...GeneralConfigContainer_settings
|
|
...OrganizationConfigContainer_settings
|
|
...WordListConfigContainer_settings
|
|
...AdvancedConfigContainer_settings
|
|
}
|
|
clientMutationId
|
|
}
|
|
}
|
|
`;
|
|
|
|
let clientMutationId = 0;
|
|
|
|
function commit(environment: Environment, input: UpdateSettingsInput) {
|
|
return commitMutationPromiseNormalized<MutationTypes>(environment, {
|
|
mutation,
|
|
variables: {
|
|
input: {
|
|
...input,
|
|
clientMutationId: (clientMutationId++).toString(),
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
export const withUpdateSettingsMutation = createMutationContainer(
|
|
"updateSettings",
|
|
commit
|
|
);
|
|
|
|
export type UpdateSettingsMutation = (
|
|
input: UpdateSettingsInput
|
|
) => MutationResponsePromise<MutationTypes, "updateSettings">;
|