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
a30114f7
Commit
a30114f7
authored
Jul 31, 2018
by
A. Koch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create archive with title, remove console log
parent
c66cbedd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
src/archives.js
src/archives.js
+2
-2
src/profiles.js
src/profiles.js
+1
-2
No files found.
src/archives.js
View file @
a30114f7
...
...
@@ -7,7 +7,7 @@ const
os
=
require
(
'
os
'
),
multer
=
require
(
'
multer
'
),
send
=
require
(
'
@polka/send-type
'
),
{
Assert
}
=
require
(
'
mbjs-utils
'
)
{
Assert
,
ObjectUtil
}
=
require
(
'
mbjs-utils
'
)
module
.
exports
.
setupArchives
=
(
app
,
mapService
,
annotationService
)
=>
{
const
upload
=
multer
({
dest
:
os
.
tmpdir
()
})
...
...
@@ -129,7 +129,7 @@ module.exports.createArchive = async (data) => {
Assert
.
ok
(
Array
.
isArray
(
data
.
annotations
),
'
data.annotations must be array
'
)
const
dir
=
path
.
join
(
os
.
tmpdir
(),
`
map_
archive_
${
data
.
map
.
uuid
}
`
),
dir
=
path
.
join
(
os
.
tmpdir
(),
`archive_
${
ObjectUtil
.
slug
(
data
.
map
.
title
)}
_
${
data
.
map
.
uuid
}
`
),
archive
=
new
yazl
.
ZipFile
()
await
new
Promise
((
resolve
,
reject
)
=>
{
...
...
src/profiles.js
View file @
a30114f7
...
...
@@ -69,7 +69,6 @@ class Profiles extends TinyEmitter {
}
async
getHandler
(
req
,
res
)
{
console
.
log
(
req
.
params
)
const
results
=
await
this
.
_client
.
find
({
user
:
req
.
params
.
id
},
req
.
params
)
if
(
results
.
length
)
{
return
this
.
_response
(
req
,
res
,
results
[
0
])
...
...
@@ -78,7 +77,7 @@ class Profiles extends TinyEmitter {
}
_response
(
req
,
res
,
data
=
{})
{
this
.
emit
(
'
message
'
,
{
method
:
req
.
method
,
id
:
data
.
id
})
this
.
emit
(
'
message
'
,
{
method
:
req
.
method
,
id
:
data
.
uu
id
})
if
(
typeof
res
===
'
function
'
)
res
({
data
})
else
if
(
typeof
res
===
'
undefined
'
)
return
Promise
.
resolve
({
data
})
else
send
(
res
,
200
,
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