@kaspernj/api-maker 1.0.279 → 1.0.280

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/devise.mjs +8 -4
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.279",
19
+ "version": "1.0.280",
20
20
  "type": "module",
21
21
  "description": "",
22
22
  "main": "index.js",
package/src/devise.mjs CHANGED
@@ -63,9 +63,12 @@ export default class ApiMakerDevise {
63
63
  return {model, response}
64
64
  }
65
65
 
66
- static updateSession (model) {
67
- const scope = digg(model.modelClassData(), "name")
68
- const camelizedScopeName = inflection.camelize(scope, true)
66
+ static updateSession (model, args = {}) {
67
+ if (!args.scope) {
68
+ args.scope = digg(model.modelClassData(), "name")
69
+ }
70
+
71
+ const camelizedScopeName = inflection.camelize(args.scope, true)
69
72
 
70
73
  ApiMakerDevise.current().currents[camelizedScopeName] = model
71
74
  }
@@ -75,8 +78,9 @@ export default class ApiMakerDevise {
75
78
  }
76
79
 
77
80
  static async signOut (args = {}) {
78
- if (!args.scope)
81
+ if (!args.scope) {
79
82
  args.scope = "user"
83
+ }
80
84
 
81
85
  const response = await Services.current().sendRequest("Devise::SignOut", {args})
82
86