c2-mongoose 2.1.116 → 2.1.117
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.
|
@@ -4,14 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var express_http_context_1 = __importDefault(require("express-http-context"));
|
|
7
|
+
var mongoose_1 = require("mongoose");
|
|
7
8
|
var BuildLogFlowItem = /** @class */ (function () {
|
|
8
9
|
function BuildLogFlowItem() {
|
|
9
10
|
}
|
|
10
11
|
BuildLogFlowItem.prototype.build = function (options, dataAfter, operation, repository) {
|
|
11
12
|
var _a;
|
|
12
13
|
return {
|
|
13
|
-
user: (_a = options.user) !== null && _a !== void 0 ? _a : express_http_context_1.default.get("user")._id,
|
|
14
|
-
owner: options.owner,
|
|
14
|
+
user: new mongoose_1.Types.ObjectId((_a = options.user) !== null && _a !== void 0 ? _a : express_http_context_1.default.get("user")._id),
|
|
15
|
+
owner: new mongoose_1.Types.ObjectId(options.owner),
|
|
15
16
|
data: dataAfter,
|
|
16
17
|
collectionName: repository.collection.name,
|
|
17
18
|
operation: operation
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import httpContext from "express-http-context"
|
|
2
2
|
import { ILogger, TypeOfOperation } from "../../model/Logger"
|
|
3
3
|
import { Options } from "../../types/Options"
|
|
4
|
-
import mongoose from "mongoose"
|
|
4
|
+
import mongoose, { Types } from "mongoose"
|
|
5
5
|
|
|
6
6
|
class BuildLogFlowItem {
|
|
7
7
|
build(options: Partial<Options>, dataAfter: any, operation: TypeOfOperation, repository: mongoose.Model<any>): Partial<ILogger> {
|
|
8
8
|
return {
|
|
9
|
-
user: options.user ?? httpContext.get("user")._id,
|
|
10
|
-
owner: options.owner,
|
|
9
|
+
user: new Types.ObjectId(options.user ?? httpContext.get("user")._id),
|
|
10
|
+
owner: new Types.ObjectId(options.owner),
|
|
11
11
|
data: dataAfter,
|
|
12
12
|
collectionName: repository.collection.name,
|
|
13
13
|
operation
|