@duvdu-v1/duvdu 1.1.164 → 1.1.165

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.
@@ -60,7 +60,7 @@ const userSchema = new mongoose_1.Schema({
60
60
  ],
61
61
  address: { type: String, default: null },
62
62
  likes: { type: Number, default: 0 },
63
- rank: { title: { type: String, default: null }, nextRankPercentage: { type: Number, default: 0 }, nextRankTitle: { type: String, default: null } },
63
+ rank: { title: { type: String, default: null }, nextRankPercentage: { type: Number, default: 0 }, nextRankTitle: { type: String, default: null }, color: { type: String, default: null } },
64
64
  projectsView: { type: Number, default: 0 }
65
65
  }, {
66
66
  timestamps: true,
@@ -16,6 +16,7 @@ const updateRankForUser = (user) => __awaiter(void 0, void 0, void 0, function*
16
16
  const nextRank = yield ranks_model_1.Rank.findOne({ actionCount: { $gt: user.acceptedProjectsCounter } }).sort({ actionCount: 1 }).exec();
17
17
  if (currentRank) {
18
18
  user.rank.title = currentRank.rank;
19
+ user.rank.color = currentRank.color;
19
20
  if (nextRank) {
20
21
  const actionsNeeded = nextRank.actionCount - currentRank.actionCount;
21
22
  const actionsCompleted = user.acceptedProjectsCounter - currentRank.actionCount;
@@ -30,6 +31,7 @@ const updateRankForUser = (user) => __awaiter(void 0, void 0, void 0, function*
30
31
  user.rank.title = null;
31
32
  user.rank.nextRangPercentage = 0;
32
33
  user.rank.nextRankTitle = null;
34
+ user.rank.color = null;
33
35
  }
34
36
  return user.save();
35
37
  });
@@ -100,6 +100,7 @@ export interface Iuser {
100
100
  title: string | null;
101
101
  nextRangPercentage: number;
102
102
  nextRankTitle: string | null;
103
+ color: string | null;
103
104
  };
104
105
  projectsView: number;
105
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.164",
3
+ "version": "1.1.165",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [