@things-factory/personalization 7.0.1-alpha.80 → 7.0.1-alpha.84

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": "@things-factory/personalization",
3
- "version": "7.0.1-alpha.80",
3
+ "version": "7.0.1-alpha.84",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -32,8 +32,8 @@
32
32
  "@operato/i18n": "^2.0.0-alpha.0",
33
33
  "@operato/shell": "^2.0.0-alpha.0",
34
34
  "@operato/styles": "^2.0.0-alpha.0",
35
- "@things-factory/auth-base": "^7.0.1-alpha.78",
35
+ "@things-factory/auth-base": "^7.0.1-alpha.81",
36
36
  "@things-factory/shell": "^7.0.1-alpha.71"
37
37
  },
38
- "gitHead": "1893bab2cc88910b3a3b080f450a7acf879b3011"
38
+ "gitHead": "8d9d4a9b31d985cc9f82efbfbb2ab5027646530a"
39
39
  }
@@ -15,7 +15,7 @@ export class PagePreferenceQuery {
15
15
  })
16
16
  }
17
17
 
18
- @Query(returns => PagePreference, { nullable: true, description: `To fetch a User's own Gridpersonalize` })
18
+ @Query(returns => PagePreference, { nullable: true, description: `To fetch a User's own PagePreference` })
19
19
  async myPagePreference(
20
20
  @Arg('page') page: string,
21
21
  @Arg('element') element: string,
@@ -28,6 +28,15 @@ export class PagePreferenceQuery {
28
28
  })
29
29
  }
30
30
 
31
+ @Query(returns => [PagePreference], { nullable: true, description: `To fetch a User's own PagePreference` })
32
+ async myPageAllPreferences(@Arg('page') page: string, @Ctx() context: any): Promise<PagePreference[]> {
33
+ const { domain, user } = context.state
34
+
35
+ return await getRepository(PagePreference).find({
36
+ where: { domain: { id: domain.id }, user: { id: user.id }, page }
37
+ })
38
+ }
39
+
31
40
  @Query(returns => PagePreferenceList, { description: 'To fetch multiple PagePreferences' })
32
41
  async myPagePreferences(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<PagePreferenceList> {
33
42
  const { domain, user } = context.state