Skip to content

Commit 5255455

Browse files
committed
Make ObjectIds constant
1 parent c7c3f38 commit 5255455

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

constants/role.constant.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ const accountRole = {
1919
};
2020

2121
const adminRole = {
22-
"_id": mongoose.Types.ObjectId(),
22+
"_id": mongoose.Types.ObjectId.createFromTime(1),
2323
"name": Constants.General.STAFF,
2424
"routes": Constants.Routes.listAllRoutes(),
2525
};
2626

2727
const hackerRole = {
28-
"_id": mongoose.Types.ObjectId(),
28+
"_id": mongoose.Types.ObjectId.createFromTime(2),
2929
"name": Constants.General.HACKER,
3030
"routes": [
3131
Constants.Routes.accountRoutes.getSelf,
@@ -42,7 +42,7 @@ const hackerRole = {
4242
};
4343

4444
const volunteerRole = {
45-
"_id": mongoose.Types.ObjectId(),
45+
"_id": mongoose.Types.ObjectId.createFromTime(3),
4646
"name": Constants.General.VOLUNTEER,
4747
"routes": [
4848
Constants.Routes.volunteerRoutes.post,
@@ -53,7 +53,7 @@ const volunteerRole = {
5353
};
5454

5555
const sponsorT1Role = {
56-
"_id": mongoose.Types.ObjectId(),
56+
"_id": mongoose.Types.ObjectId.createFromTime(4),
5757
"name": Constants.General.SPONSOR_T1,
5858
"routes": [
5959
Constants.Routes.sponsorRoutes.post,
@@ -62,7 +62,7 @@ const sponsorT1Role = {
6262
};
6363

6464
const sponsorT2Role = {
65-
"_id": mongoose.Types.ObjectId(),
65+
"_id": mongoose.Types.ObjectId.createFromTime(5),
6666
"name": Constants.General.SPONSOR_T2,
6767
"routes": [
6868
Constants.Routes.sponsorRoutes.post,
@@ -71,7 +71,7 @@ const sponsorT2Role = {
7171
};
7272

7373
const sponsorT3Role = {
74-
"_id": mongoose.Types.ObjectId(),
74+
"_id": mongoose.Types.ObjectId.createFromTime(6),
7575
"name": Constants.General.SPONSOR_T3,
7676
"routes": [
7777
Constants.Routes.sponsorRoutes.post,
@@ -80,7 +80,7 @@ const sponsorT3Role = {
8080
};
8181

8282
const sponsorT4Role = {
83-
"_id": mongoose.Types.ObjectId(),
83+
"_id": mongoose.Types.ObjectId.createFromTime(7),
8484
"name": Constants.General.SPONSOR_T4,
8585
"routes": [
8686
Constants.Routes.sponsorRoutes.post,

0 commit comments

Comments
 (0)