backend-manager 3.0.39 → 3.0.40
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 +1 -1
- package/src/manager/helpers/usage.js +16 -1
package/package.json
CHANGED
|
@@ -194,7 +194,22 @@ Usage.prototype.increment = function (path, value, options) {
|
|
|
194
194
|
});
|
|
195
195
|
|
|
196
196
|
// Log the updated user
|
|
197
|
-
self.log(`Usage.init(): Incremented user`, self.user);
|
|
197
|
+
self.log(`Usage.init(): Incremented ${path} for user`, self.user);
|
|
198
|
+
|
|
199
|
+
return self;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
Usage.prototype.set = function (path, value) {
|
|
203
|
+
const self = this;
|
|
204
|
+
const Manager = self.Manager;
|
|
205
|
+
const assistant = self.assistant;
|
|
206
|
+
|
|
207
|
+
// Update total and period
|
|
208
|
+
const resolved = `usage.${path}.${key}`;
|
|
209
|
+
_.set(self.user, resolved, value);
|
|
210
|
+
|
|
211
|
+
// Log the updated user
|
|
212
|
+
self.log(`Usage.init(): Set ${path} for user`, self.user);
|
|
198
213
|
|
|
199
214
|
return self;
|
|
200
215
|
};
|