Gitlab@Informatics
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nail-spa-project-meloncd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
65160014
nail-spa-project-meloncd
Commits
150339f2
Commit
150339f2
authored
2 weeks ago
by
65160014
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parent
7d3795ee
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app.js
+1
-1
1 addition, 1 deletion
app.js
controllers/authController.js
+1
-1
1 addition, 1 deletion
controllers/authController.js
models/userModel.js
+1
-1
1 addition, 1 deletion
models/userModel.js
with
3 additions
and
3 deletions
app.js
+
1
−
1
View file @
150339f2
...
...
@@ -10,7 +10,7 @@ const db = mysql.createPool({
port
:
process
.
env
.
DB_PORT
,
user
:
process
.
env
.
DB_USER
,
password
:
process
.
env
.
DB_PASSWORD
,
database
:
process
.
env
.
DB_NAME
,
// replace with your database name
database
:
process
.
env
.
DB_NAME
,
waitForConnections
:
true
,
connectionLimit
:
10
,
queueLimit
:
0
...
...
This diff is collapsed.
Click to expand it.
controllers/authController.js
+
1
−
1
View file @
150339f2
...
...
@@ -14,7 +14,7 @@ module.exports = {
loginSubmit
:
(
req
,
res
)
=>
{
const
{
email
,
password
}
=
req
.
body
;
db
.
query
(
'
SELECT * FROM
U
sers WHERE email = ?
'
,
[
email
],
(
err
,
result
)
=>
{
db
.
query
(
'
SELECT * FROM
u
sers WHERE email = ?
'
,
[
email
],
(
err
,
result
)
=>
{
if
(
err
)
throw
err
;
if
(
result
.
length
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
models/userModel.js
+
1
−
1
View file @
150339f2
...
...
@@ -3,7 +3,7 @@ const db = require('../app').db;
module
.
exports
=
{
// ฟังก์ชันในการดึงข้อมูล user โดยใช้ email
getUserByEmail
:
(
email
,
callback
)
=>
{
db
.
query
(
'
SELECT * FROM
U
sers WHERE email = ?
'
,
[
email
],
(
err
,
result
)
=>
{
db
.
query
(
'
SELECT * FROM
u
sers WHERE email = ?
'
,
[
email
],
(
err
,
result
)
=>
{
if
(
err
)
return
callback
(
err
);
callback
(
null
,
result
);
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment