@duvdu-v1/duvdu 1.1.150 → 1.1.151
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.
|
@@ -16,8 +16,8 @@ const projectViews_model_1 = require("../models/projectViews.model");
|
|
|
16
16
|
const User_model_1 = require("../models/User.model");
|
|
17
17
|
const incrementProjectsView = (userId, projectId, lang) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
18
|
try {
|
|
19
|
-
const user = yield User_model_1.Users.findById(userId);
|
|
20
|
-
const project = yield allProjects_model_1.Project.findOne({ project: projectId });
|
|
19
|
+
const user = (yield User_model_1.Users.findById(userId));
|
|
20
|
+
const project = yield allProjects_model_1.Project.findOne({ 'project.type': projectId });
|
|
21
21
|
if (!user)
|
|
22
22
|
throw new notfound_error_1.NotFound({ en: 'user not found', ar: 'لم يتم العثور على المستخدم' }, lang);
|
|
23
23
|
user.projectsView += 1;
|