Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Motion Bank
Services
Motion Bank API
Commits
037c01b7
Commit
037c01b7
authored
Oct 31, 2019
by
Anton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PBA response in case of unconfigured endpoint
parent
9dd5bc72
Pipeline
#19660
passed with stage
in 1 minute and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/lib/pba.js
src/lib/pba.js
+2
-2
No files found.
src/lib/pba.js
View file @
037c01b7
...
...
@@ -24,13 +24,13 @@ class PBA extends TinyEmitter {
async
getPiecesHandler
(
req
,
res
)
{
const
result
=
await
this
.
_performRequest
(
'
pieces
'
)
if
(
result
)
this
.
_response
(
req
,
res
,
result
.
pieces
)
else
this
.
_errorResponse
(
{}
,
503
,
'
PBA vocabularies not available
'
)
else
this
.
_errorResponse
(
res
,
503
,
'
PBA vocabularies not available
'
)
}
async
getTitlesForPieceHandler
(
req
,
res
)
{
const
result
=
await
this
.
_performRequest
(
`titles/
${
req
.
params
.
piece_id
}
`
)
if
(
result
)
this
.
_response
(
req
,
res
,
result
.
titles
)
else
this
.
_errorResponse
(
{}
,
503
,
'
PBA vocabularies not available
'
)
else
this
.
_errorResponse
(
res
,
503
,
'
PBA vocabularies not available
'
)
}
_response
(
req
,
res
,
data
=
{})
{
...
...
Write
Preview
Markdown
is supported
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