Skip to content

Commit

Permalink
Changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jaewonhimnae committed May 3, 2020
1 parent 7586cc2 commit 0d5061f
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 72 deletions.
24 changes: 0 additions & 24 deletions client/src/components/views/RegisterPage/RegisterPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,13 @@ function RegisterPage(props) {

<Formik
initialValues={{
account: '',
email: '',
lastName: '',
name: '',
password: '',
confirmPassword: '',
company: ''
}}
validationSchema={Yup.object().shape({
account: Yup.string()
.required('Account is required')
.matches(accountRegExp, 'Only 3 ~ 20 Alphabetic, _, -, . , @'),
name: Yup.string()
.required('Name is required'),
email: Yup.string()
Expand All @@ -66,13 +61,11 @@ function RegisterPage(props) {
onSubmit={(values, { setSubmitting }) => {
setTimeout(() => {
let dataToSubmit = {
account: values.account,
email: values.email,
password: values.password,
name: values.name,
// lastname: values.lastname,
image: `uploads/images/no-user.svg`,
company: parseInt(values.company, 10)
};

dispatch(registerUser(dataToSubmit)).then(response => {
Expand Down Expand Up @@ -103,23 +96,6 @@ function RegisterPage(props) {

<Form style={{ minWidth: '375px' }} {...formItemLayout} onSubmit={handleSubmit} >

<Form.Item required label="account">
<Input
id="account"
placeholder="account"
type="text"
value={values.account}
onChange={handleChange}
onBlur={handleBlur}
className={
errors.account && touched.account ? 'text-input error' : 'text-input'
}
/>
{errors.account && touched.account && (
<div className="input-feedback">{errors.account}</div>
)}
</Form.Item>

<Form.Item required label="name">
<Input
id="name"
Expand Down
4 changes: 2 additions & 2 deletions client/src/hoc/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export default function (ComposedClass, reload, adminRoute = null) {
}
else {
if (reload === false) {
props.history.push('/posts')
props.history.push('/')
}
}
}
})

}, [dispatch, props.history, user.googleAuth])

return (
Expand Down
4 changes: 4 additions & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ pre {
}
}

.input-feedback {
color: red;
}

/* =================================
Scroll-y
================================= */
Expand Down
135 changes: 135 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 6 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "uc-voice-of-customer",
"version": "1.0.0",
"description": "voice of customer",
"name": "boiler-plate-version-two",
"version": "2.0.0",
"description": "boiler plate version two",
"main": "index.js",
"engine": {
"node": "10.16.0",
Expand All @@ -21,19 +21,14 @@
"cookie-parser": "^1.4.4",
"cors": "^2.8.5",
"crypto": "^1.0.1",
"dialogflow": "^1.1.2",
"dialogflow-fulfillment": "^0.6.1",
"express": "^4.17.1",
"fluent-ffmpeg": "^2.1.2",
"helmet": "^3.22.0",
"jsonwebtoken": "^8.5.1",
"moment": "^2.24.0",
"mongoose": "^5.4.20",
"mongoose-sequence": "^5.2.2",
"multer": "^1.4.2",
"nodemailer": "^6.4.2",
"saslprep": "^1.0.3",
"socket.io": "^2.2.0",
"store": "^2.0.12"
"nodemailer": "^6.4.2"
},
"devDependencies": {
"concurrently": "^4.1.0",
Expand All @@ -43,4 +38,4 @@
"babel-preset-env": "^1.7.0",
"morgan": "^1.9.1"
}
}
}
14 changes: 12 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,30 @@ import bodyParser from 'body-parser';
import cookieParser from 'cookie-parser';
import morgan from 'morgan';
import config from './config/key';
import helmet from 'helmet';

const app = express();

mongoose.connect(config.mongoURI,
{ useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false })
{
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
useCreateIndex: true
})
.then(() => console.log('MongoDB Connected...'))
.catch(err => console.log(err));
.catch(err => console.error(err));

//to not get any deprecation warning or error
//support parsing of application/x-www-form-urlencoded post data
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());

app.use(cookieParser());

// Helmet helps you secure your Express apps by setting various HTTP headers.
app.use(helmet())

// Logger Middleware
app.use(morgan('dev'));

Expand Down
Loading

0 comments on commit 0d5061f

Please sign in to comment.