@openneuro/server 4.19.0 → 4.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/server",
3
- "version": "4.19.0",
3
+ "version": "4.19.1",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@apollo/client": "3.7.2",
19
19
  "@elastic/elasticsearch": "7.15.0",
20
- "@openneuro/search": "^4.19.0",
20
+ "@openneuro/search": "^4.19.1",
21
21
  "@passport-next/passport-google-oauth2": "^1.0.0",
22
22
  "@sentry/node": "^4.5.3",
23
23
  "apollo-server": "2.25.4",
@@ -92,5 +92,5 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "gitHead": "3c492035f9762ceabc8a717866f6d4e78fdcf7a9"
95
+ "gitHead": "8b7c694dbafc962fe57a4a0605b7722c9c0321c3"
96
96
  }
@@ -22,7 +22,10 @@ export const metadata = async (dataset, _, context) => {
22
22
  const adminUsers = []
23
23
  const { userPermissions } = await permissions(dataset)
24
24
  for (const user of userPermissions) {
25
- adminUsers.push((await user.user).email)
25
+ if (user.level === 'admin') {
26
+ const userObj = await user.user
27
+ adminUsers.push(userObj.email)
28
+ }
26
29
  }
27
30
  const firstSnapshot = await Snapshot.find({ datasetId: dataset.id }).sort({
28
31
  created: 1,
@@ -33,15 +36,17 @@ export const metadata = async (dataset, _, context) => {
33
36
  return {
34
37
  ...record,
35
38
  datasetId: dataset.id,
36
- datasetName: description.Name,
37
- tasksCompleted: summary.tasks,
38
- seniorAuthor: description.Authors[description.Authors.length - 1],
39
+ datasetName: description?.Name,
40
+ tasksCompleted: summary?.tasks || [],
41
+ seniorAuthor: description?.Authors
42
+ ? description.Authors[description.Authors.length - 1]
43
+ : null,
39
44
  adminUsers,
40
45
  firstSnapshotCreatedAt,
41
46
  latestSnapshotCreatedAt: snapshot.created,
42
47
  subjectAges: summary.subjectMetadata.map(s => s.age),
43
- modalities: summary.modalities,
44
- dataProcessed: summary.dataProcessed,
48
+ modalities: summary?.modalities || [],
49
+ dataProcessed: summary?.dataProcessed || null,
45
50
  }
46
51
  }
47
52