center: use addToSet instead of push

This commit is contained in:
undefined committed 2023-04-09 17:08:50 +08:00
1 parent 330470f9b2
commit dc76742e30
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -67,7 +67,7 @@ class DataReportHandler extends Handler {
await coll.updateOne( await coll.updateOne(
{ _id: installId }, { _id: installId },
{ {
$push: { $addToSet: {
ips: this.request.ip, ips: this.request.ip,
}, },
$set: { downgrade: setPayload }, $set: { downgrade: setPayload },
@@ -75,7 +75,7 @@ class DataReportHandler extends Handler {
); );
} else { } else {
await coll.updateOne({ _id: installId }, { await coll.updateOne({ _id: installId }, {
$push: { $addToSet: {
ips: this.request.ip, ips: this.request.ip,
}, },
$set: setPayload, $set: setPayload,
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/center", "name": "@hydrooj/center",
"version": "0.2.5", "version": "0.2.6",
"main": "index.ts", "main": "index.ts",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",