Skip to content

Commit ece7dd7

Browse files
committed
[Update] change the name to agentname for joinInfo.
1 parent 42afd7a commit ece7dd7

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/components/Join.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface JoinProps extends RouteComponentProps<{}> {
2727

2828
interface JoinState {
2929
loading: boolean;
30-
name: string;
30+
agentName: string;
3131
telegram: string;
3232
regions: Set<string>;
3333
other: string;
@@ -37,7 +37,7 @@ interface JoinState {
3737
class Join extends React.Component<JoinProps, JoinState> {
3838
state = {
3939
loading: true,
40-
name: '',
40+
agentName: '',
4141
telegram: '',
4242
regions: new Set(),
4343
other: '',
@@ -57,7 +57,7 @@ class Join extends React.Component<JoinProps, JoinState> {
5757
query: gql`
5858
query {
5959
info: joinInfo {
60-
name
60+
agentName
6161
telegram
6262
regions
6363
other
@@ -77,7 +77,7 @@ class Join extends React.Component<JoinProps, JoinState> {
7777

7878
this.setState({
7979
loading: false,
80-
name: info.name,
80+
agentName: info.agentName,
8181
telegram: info.telegram,
8282
regions: new Set(info.regions),
8383
other: info.other,
@@ -92,21 +92,21 @@ class Join extends React.Component<JoinProps, JoinState> {
9292
apollo.mutate<{ info: JoinInfo }>({
9393
mutation: gql`
9494
mutation(
95-
$name: String!,
95+
$agentName: String!,
9696
$telegram: String!,
9797
$regions: [String]!,
9898
$other: String,
9999
) {
100100
info: join(
101-
name: $name,
101+
agentName: $agentName,
102102
telegram: $telegram,
103103
regions: $regions,
104104
other: $other
105105
) { updatedAt }
106106
}
107107
`,
108108
variables: {
109-
name: this.state.name,
109+
agentName: this.state.agentName,
110110
telegram: this.state.telegram,
111111
regions: Array.from(this.state.regions),
112112
other: this.state.other
@@ -178,8 +178,8 @@ class Join extends React.Component<JoinProps, JoinState> {
178178
<Form.Item label="特工代号">
179179
<Input
180180
prefix={<Icon type="user" />}
181-
name="name"
182-
value={this.state.name}
181+
name="agentName"
182+
value={this.state.agentName}
183183
placeholder="Agent Name"
184184
onChange={this.handleChange}
185185
/>

src/components/Register.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ class Register extends React.Component<LoginProps, LoginState> {
109109
<Alert message={this.state.error} type="error" closable />
110110
)}
111111

112-
<Form.Item label="特工代号">
112+
<Form.Item label="用户名">
113113
<Input
114114
name="name"
115115
prefix={<Icon type="user" />}
116-
placeholder="Agent Codename"
116+
placeholder="Username"
117117
value={this.state.name}
118118
onChange={this.handleChange}
119119
/>

src/types/JoinInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface JoinInfo {
2-
name: string;
2+
agentName: string;
33
telegram: string;
44
regions: Array<string>;
55
other: string;

0 commit comments

Comments
 (0)