@openneuro/server 4.36.0 → 4.36.2

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.36.0",
3
+ "version": "4.36.2",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -21,7 +21,7 @@
21
21
  "@elastic/elasticsearch": "8.13.1",
22
22
  "@graphql-tools/schema": "^10.0.0",
23
23
  "@keyv/redis": "^2.7.0",
24
- "@openneuro/search": "^4.36.0",
24
+ "@openneuro/search": "^4.36.2",
25
25
  "@sentry/node": "^8.25.0",
26
26
  "@sentry/profiling-node": "^8.25.0",
27
27
  "base64url": "^3.0.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "ac7fa1782779cfdf1f46c9a5add8865155177b99"
89
+ "gitHead": "b5acb4d59334f72298be62066e4064d59c8e10bc"
90
90
  }
@@ -105,7 +105,7 @@ export const deleteComment = async (
105
105
  const CommentFields = {
106
106
  parent: (obj) => comment(obj, { id: obj.parentId }),
107
107
  replies,
108
- user: (obj) => user(obj, { id: obj.user._id }, null),
108
+ user: (obj) => user(obj, { id: obj.user._id }),
109
109
  }
110
110
 
111
111
  export default CommentFields
@@ -34,7 +34,7 @@ const publishPermissions = async (datasetId) => {
34
34
  userPermissions: await Promise.all(
35
35
  userPermissions.map(async (userPermission) => ({
36
36
  ...userPermission,
37
- user: await user(ds, { id: userPermission.userId }, null),
37
+ user: await user(ds, { id: userPermission.userId }),
38
38
  })),
39
39
  ),
40
40
  }
@@ -7,7 +7,11 @@ function isValidOrcid(orcid: string): boolean {
7
7
  return /^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$/.test(orcid || "")
8
8
  }
9
9
 
10
- export async function user(obj, { id }, { userInfo }) {
10
+ export async function user(
11
+ obj,
12
+ { id },
13
+ { userInfo }: { userInfo?: Record<string, unknown> } = {},
14
+ ) {
11
15
  let user
12
16
  if (isValidOrcid(id)) {
13
17
  user = await User.findOne({