Toggle navigation
Toggle navigation
This project
Loading...
Sign in
오세헌
/
Ingredient-to-Dish-ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
전언석
2022-06-09 15:17:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4bd2d68593e1701824c4629234ed641fda1f5c0f
4bd2d685
1 parent
0e70b5ad
FIX : an error(arr2) are fixed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
I_to_D_chatbot/reply.js
I_to_D_chatbot/reply.js
View file @
4bd2d68
...
...
@@ -16,7 +16,6 @@ app.use(bodyParser.json());
app
.
post
(
'/hook'
,
function
(
req
,
res
)
{
var
eventObj
=
req
.
body
.
events
[
0
];
var
source
=
eventObj
.
source
;
var
message
=
eventObj
.
message
;
function
output_message
(
results
,
list
)
{
...
...
@@ -64,6 +63,7 @@ app.post('/hook', function (req, res) {
db
.
connect
();
var
max
=
0
;
var
arr2
;
db
.
query
(
'SELECT * FROM recipe'
,
function
(
error
,
results
,
fields
)
{
if
(
error
)
{
...
...
@@ -77,7 +77,7 @@ app.post('/hook', function (req, res) {
var
count
=
ingredients_list
.
filter
(
x
=>
input_ingredients_list
.
includes
(
x
)).
length
;
if
(
count
>
max
)
{
max
=
count
;
var
arr2
=
new
Array
();
arr2
=
new
Array
();
}
if
(
count
===
input_ingredients_list
.
length
)
{
arr1
.
push
(
i
);
...
...
@@ -91,7 +91,7 @@ app.post('/hook', function (req, res) {
output_message
(
results
,
arr1
);
}
else
if
(
arr2
.
length
!=
0
)
{
else
if
(
arr2
!=
undefined
)
{
output_message
(
results
,
arr2
);
}
else
{
...
...
Please
register
or
login
to post a comment