Skip to content

Commit f5251a9

Browse files
committed
fix: change exists-email query name
1 parent 9cab6c2 commit f5251a9

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

scripts/start.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
'use strict';
2-
31
// Do this as the first thing so that any code reading it knows the right env.
42
process.env.BABEL_ENV = 'development';
53
process.env.NODE_ENV = 'development';
64

75
// Makes the script crash on unhandled rejections instead of silently
86
// ignoring them. In the future, promise rejections that are not handled will
97
// terminate the Node.js process with a non-zero exit code.
10-
process.on('unhandledRejection', err => {
8+
process.on('unhandledRejection', (err) => {
119
throw err;
1210
});
1311

1412
// Ensure environment variables are read.
1513
require('../config/env');
1614

17-
1815
const fs = require('fs');
1916
const chalk = require('react-dev-utils/chalk');
2017
const webpack = require('webpack');
@@ -48,15 +45,15 @@ if (process.env.HOST) {
4845
console.log(
4946
chalk.cyan(
5047
`Attempting to bind to HOST environment variable: ${chalk.yellow(
51-
chalk.bold(process.env.HOST)
52-
)}`
53-
)
48+
chalk.bold(process.env.HOST),
49+
)}`,
50+
),
5451
);
5552
console.log(
56-
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
53+
`If this was unintentional, check that you haven't mistakenly set it in your shell.`,
5754
);
5855
console.log(
59-
`Learn more here: ${chalk.yellow('https://bit.ly/CRA-advanced-config')}`
56+
`Learn more here: ${chalk.yellow('https://bit.ly/CRA-advanced-config')}`,
6057
);
6158
console.log();
6259
}
@@ -70,7 +67,7 @@ checkBrowsers(paths.appPath, isInteractive)
7067
// run on a different port. `choosePort()` Promise resolves to the next free port.
7168
return choosePort(HOST, DEFAULT_PORT);
7269
})
73-
.then(port => {
70+
.then((port) => {
7471
if (port == null) {
7572
// We have not found a port.
7673
return;
@@ -82,9 +79,9 @@ checkBrowsers(paths.appPath, isInteractive)
8279
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
8380
const urls = prepareUrls(protocol, HOST, port);
8481
const devSocket = {
85-
warnings: warnings =>
82+
warnings: (warnings) =>
8683
devServer.sockWrite(devServer.sockets, 'warnings', warnings),
87-
errors: errors =>
84+
errors: (errors) =>
8885
devServer.sockWrite(devServer.sockets, 'errors', errors),
8986
};
9087
// Create a webpack compiler that is configured with custom messages.
@@ -99,16 +96,19 @@ checkBrowsers(paths.appPath, isInteractive)
9996
webpack,
10097
});
10198
// Load proxy config
102-
const proxySetting = require(paths.appPackageJson).proxy;
99+
const proxySetting =
100+
process.env.NODE_ENV !== 'production'
101+
? process.env.REACT_APP_API_HOST
102+
: require(paths.appPackageJson).proxy;
103103
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
104104
// Serve webpack assets generated by the compiler over a web server.
105105
const serverConfig = createDevServerConfig(
106106
proxyConfig,
107-
urls.lanUrlForConfig
107+
urls.lanUrlForConfig,
108108
);
109109
const devServer = new WebpackDevServer(compiler, serverConfig);
110110
// Launch WebpackDevServer.
111-
devServer.listen(port, HOST, err => {
111+
devServer.listen(port, HOST, (err) => {
112112
if (err) {
113113
return console.log(err);
114114
}
@@ -122,8 +122,8 @@ checkBrowsers(paths.appPath, isInteractive)
122122
if (process.env.NODE_PATH) {
123123
console.log(
124124
chalk.yellow(
125-
'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.'
126-
)
125+
'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.',
126+
),
127127
);
128128
console.log();
129129
}
@@ -132,14 +132,14 @@ checkBrowsers(paths.appPath, isInteractive)
132132
openBrowser(urls.localUrlForBrowser);
133133
});
134134

135-
['SIGINT', 'SIGTERM'].forEach(function(sig) {
136-
process.on(sig, function() {
135+
['SIGINT', 'SIGTERM'].forEach(function (sig) {
136+
process.on(sig, function () {
137137
devServer.close();
138138
process.exit();
139139
});
140140
});
141141
})
142-
.catch(err => {
142+
.catch((err) => {
143143
if (err && err.message) {
144144
console.log(err.message);
145145
}

src/components/setting/SettingEmailRow.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function SettingEmailRow({
2121
onChangeEmail,
2222
}: SettingEmailRowProps) {
2323
const [edit, setEdit] = useState(false);
24-
const [value, onChange] = useInput(email);
24+
const [value, onChange] = useInput(email ?? '');
2525

2626
const onSubmit = async (e: React.FormEvent) => {
2727
e.preventDefault();
@@ -36,13 +36,13 @@ function SettingEmailRow({
3636
return;
3737
}
3838

39-
const response = await client.query<{ isDuplicated: boolean }>({
39+
const response = await client.query<{ emailExists: boolean }>({
4040
query: EMAIL_EXISTS,
4141
fetchPolicy: 'network-only',
42-
variables: { email: value },
42+
variables: { email: value.trim() },
4343
});
4444

45-
if (response.data) {
45+
if (response.data.emailExists) {
4646
toast.error('동일한 이메일이 존재합니다.');
4747
return;
4848
}

src/lib/graphql/user.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export const GET_USER_SERIES_LIST = gql`
131131
`;
132132

133133
export const EMAIL_EXISTS = gql`
134-
query EMAIL_EXISTS($email: String!) {
134+
query EmailExists($email: String!) {
135135
emailExists(email: $email)
136136
}
137137
`;

src/lib/hooks/useInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export default function useInput(defaultValue: string) {
1212
return [input, onChange, onReset] as [
1313
string,
1414
typeof onChange,
15-
typeof onReset
15+
typeof onReset,
1616
];
1717
}

0 commit comments

Comments
 (0)