Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
Project Page
Commits
35cc9c87
Commit
35cc9c87
authored
3 years ago
by
Rosanny Sihombing
Browse files
Options
Download
Email Patches
Plain Diff
mysql2 and async/await
parent
a1fd9038
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
functions/methods.ts
+30
-15
functions/methods.ts
package-lock.json
+200
-150
package-lock.json
with
230 additions
and
165 deletions
+230
-165
functions/methods.ts
+
30
-
15
View file @
35cc9c87
const
dbconn
=
require
(
'
../config/dbconn
'
);
const
dbconn
=
require
(
'
../config/dbconn
'
);
var
methods
=
{
var
methods
=
{
getAllMailinglists
:
function
(
callback
:
any
)
{
getAllMailinglists
:
async
function
()
{
dbconn
.
project
.
query
(
'
CALL getAllLists
'
,
function
(
err
:
any
,
rows
:
any
){
try
{
if
(
err
)
throw
err
;
let
rows
:
any
=
await
dbconn
.
project
.
promise
().
query
(
'
CALL getAllLists
'
)
callback
(
rows
[
0
],
err
);
if
(
rows
[
0
][
0
])
{
})
return
rows
[
0
][
0
]
}
else
{
return
null
}
}
catch
(
err
)
{
console
.
error
(
err
)
}
return
null
},
},
getProjectOverviewById
:
function
(
projectId
:
number
,
callback
:
any
)
{
getProjectOverviewById
:
async
function
(
projectId
:
number
)
{
dbconn
.
project
.
query
(
'
CALL GetProjectInformationByProjectID(
'
+
projectId
+
'
)
'
,
function
(
err
:
any
,
rows
:
any
){
try
{
if
(
err
)
throw
err
;
let
rows
:
any
=
await
dbconn
.
project
.
promise
().
query
(
'
CALL GetProjectInformationByProjectID(
'
+
projectId
+
'
)
'
)
callback
(
rows
[
0
],
err
);
if
(
rows
[
0
][
0
])
{
})
return
rows
[
0
][
0
]
}
else
{
return
null
}
}
catch
(
err
)
{
console
.
error
(
err
)
}
return
null
},
},
getProjectImagesById
:
function
(
projectId
:
number
,
callback
:
any
)
{
getProjectImagesById
:
async
function
(
projectId
:
number
)
{
dbconn
.
project
.
query
(
'
CALL getImagesByProjectID(
'
+
projectId
+
'
)
'
,
function
(
err
:
any
,
rows
:
any
){
try
{
if
(
err
)
throw
err
;
let
rows
:
any
=
await
dbconn
.
project
.
promise
().
query
(
'
CALL getImagesByProjectID(
'
+
projectId
+
'
)
'
)
callback
(
rows
[
0
],
err
);
if
(
rows
[
0
][
0
])
{
})
return
rows
[
0
][
0
]
}
else
{
return
null
}
}
catch
(
err
)
{
console
.
error
(
err
)
}
return
null
}
}
};
};
...
...
This diff is collapsed.
Click to expand it.
package-lock.json
+
200
-
150
View file @
35cc9c87
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment