Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
M
Motion Bank API
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Motion Bank
Services
Motion Bank API
Commits
24c3e962
Commit
24c3e962
authored
Apr 11, 2019
by
Anton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cells to archives
parent
cc9391f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
src/lib/archives.js
src/lib/archives.js
+16
-2
No files found.
src/lib/archives.js
View file @
24c3e962
...
@@ -9,9 +9,10 @@ const
...
@@ -9,9 +9,10 @@ const
send
=
require
(
'
@polka/send-type
'
),
send
=
require
(
'
@polka/send-type
'
),
config
=
require
(
'
config
'
),
config
=
require
(
'
config
'
),
Minio
=
require
(
'
minio
'
),
Minio
=
require
(
'
minio
'
),
{
Assert
,
ObjectUtil
}
=
require
(
'
mbjs-utils
'
)
{
Assert
,
ObjectUtil
}
=
require
(
'
mbjs-utils
'
),
parseURI
=
require
(
'
mbjs-data-models/src/lib/parse-uri
'
)
module
.
exports
.
setupArchives
=
(
api
,
mapService
,
annotationService
)
=>
{
module
.
exports
.
setupArchives
=
(
api
,
mapService
,
annotationService
,
cellService
)
=>
{
const
upload
=
multer
({
dest
:
os
.
tmpdir
()
})
const
upload
=
multer
({
dest
:
os
.
tmpdir
()
})
api
.
app
.
post
(
'
/archives/maps
'
,
async
(
req
,
res
)
=>
{
api
.
app
.
post
(
'
/archives/maps
'
,
async
(
req
,
res
)
=>
{
let
data
=
{}
let
data
=
{}
...
@@ -33,6 +34,19 @@ module.exports.setupArchives = (api, mapService, annotationService) => {
...
@@ -33,6 +34,19 @@ module.exports.setupArchives = (api, mapService, annotationService) => {
await
annotationService
.
findHandler
(
request
,
async
result
=>
{
await
annotationService
.
findHandler
(
request
,
async
result
=>
{
if
(
result
.
error
)
return
send
(
res
,
result
.
code
)
if
(
result
.
error
)
return
send
(
res
,
result
.
code
)
data
.
annotations
=
result
.
data
.
items
data
.
annotations
=
result
.
data
.
items
data
.
cells
=
[]
for
(
let
annotation
of
data
.
annotations
)
{
if
(
annotation
.
body
.
type
===
'
Cell
'
&&
annotation
.
body
.
source
)
{
const
cellRequest
=
{
query
:
{
uuid
:
parseURI
(
annotation
.
body
.
source
.
id
).
uuid
},
user
:
req
.
user
}
const
cell
=
await
cellService
.
getHandler
(
cellRequest
)
if
(
cell
)
data
.
cells
.
push
(
cell
)
}
}
const
url
=
await
exports
.
createArchive
(
api
,
data
)
const
url
=
await
exports
.
createArchive
(
api
,
data
)
send
(
res
,
200
,
url
)
send
(
res
,
200
,
url
)
})
})
...
...
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