@ccci/micro-server 1.0.214 → 1.0.215
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/dist/index.js +1 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -304305,11 +304305,8 @@ class BaseController {
|
|
|
304305
304305
|
try {
|
|
304306
304306
|
await this.beforeCreate(req);
|
|
304307
304307
|
let data = req.body;
|
|
304308
|
-
console.log("req.user :>> ", req.user);
|
|
304309
|
-
console.log("req.user.id :>> ", req.user.id);
|
|
304310
|
-
console.log("req.user.id :>> ", req.user._id);
|
|
304311
304308
|
if (req.user && !req.query.disableDefaultId) {
|
|
304312
|
-
data.createdById = req.user.id ?? req.user
|
|
304309
|
+
data.createdById = req.user?.userId ?? req.user.id ?? req.user?._id ?? req.user?.user?.id ?? req.user?.user?._id;
|
|
304313
304310
|
}
|
|
304314
304311
|
console.log("BaseController.create :>> ", data);
|
|
304315
304312
|
let response4 = await this._model?.create(data);
|