Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
swing-webapp
api
Commits
57ddadcb
Commit
57ddadcb
authored
May 17, 2021
by
antoine masson
Browse files
v1.11
-Add error message when poc is not defined
parent
99c22636
Changes
3
Hide whitespace changes
Inline
Side-by-side
controllers/SurveyController.js
View file @
57ddadcb
...
...
@@ -530,6 +530,11 @@ exports.getSurveyInfo= async (req, res) => {
try
{
const
survey
=
await
Survey
.
findById
(
req
.
userData
.
survey_id
);
const
poc
=
await
survey
.
poc
if
(
!
poc
)
{
return
res
.
status
(
400
)
.
json
({
message
:
"
Contact user is not defined
"
,
status
:
"
Error
"
});
}
let
surveygeneral
=
survey
.
general
;
let
languages
=
[]
...
...
controllers/TokenController.js
View file @
57ddadcb
...
...
@@ -180,7 +180,11 @@ exports.loginToken = async (req, res) => {
try
{
const
token
=
await
Token
.
findOne
({
token
:
req
.
body
.
token
});
const
gopt
=
await
GlobalOptions
.
findById
(
0
,{
poc
:
1
});
if
(
!
gopt
)
{
return
res
.
status
(
400
)
.
json
({
message
:
"
Global user is not defined
"
,
status
:
"
Error
"
});
}
if
(
!
token
)
{
return
res
.
status
(
201
)
...
...
@@ -221,6 +225,11 @@ exports.accessToken = async (req, res) => {
try
{
const
survey
=
await
Survey
.
findById
(
req
.
body
.
survey_id
)
let
spoc
=
await
survey
.
poc
if
(
!
spoc
)
{
return
res
.
status
(
400
)
.
json
({
message
:
"
Global user is not defined
"
,
status
:
"
Error
"
});
}
let
token
=
await
Token
.
findOne
({
token
:
req
.
body
.
token
});
if
(
!
survey
.
status
&&
(
!
token
||
!
token
.
test
)){
return
res
...
...
package.json
View file @
57ddadcb
{
"name"
:
"api"
,
"version"
:
"1.1.
0
"
,
"version"
:
"1.1.
1
"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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