Skip to content

Commit

Permalink
dpes bump
Browse files Browse the repository at this point in the history
  • Loading branch information
leider committed Oct 3, 2023
1 parent 87cecce commit 88eb209
Show file tree
Hide file tree
Showing 4 changed files with 285 additions and 219 deletions.
2 changes: 1 addition & 1 deletion config-examples/mongo-config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"mongoURL": "mongodb://localhost:27017/swk"
"mongoURL": "mongodb://0.0.0.0:27017/swk"
}
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
},
"dependencies": {
"@fortawesome/fontawesome-free": "6.4.2",
"@fullcalendar/luxon2": "6.1.8",
"@fullcalendar/luxon2": "6.1.9",
"@popperjs/core": "2.11.8",
"CoolBeans": "0.0.9",
"awesome-bootstrap-checkbox": "1.0.1",
"body-parser": "1.20.2",
"bootstrap": "5.3.1",
"bootstrap": "5.3.2",
"bootstrap-datepicker": "1.10.0",
"bootstrap-markdown": "2.10.0",
"compression": "1.7.4",
Expand All @@ -35,28 +35,28 @@
"express-session": "1.17.3",
"feed": "4.2.2",
"full-icu": "1.5.0",
"fullcalendar": "6.1.8",
"glob": "9.3.5",
"fullcalendar": "6.1.9",
"glob": "10.1.0",
"guillotine": "1.3.1",
"i18next": "23.4.4",
"i18next-http-middleware": "3.3.2",
"i18next": "23.5.1",
"i18next-http-middleware": "3.4.0",
"i18next-intervalplural-postprocessor": "3.0.0",
"i18next-node-fs-backend": "2.1.3",
"icalendar": "0.7.1",
"iconv-lite": "0.6.3",
"jqcloud2": "2.0.3",
"jquery": "3.7.0",
"jquery": "3.7.1",
"jquery-validation": "1.19.5",
"jsonwebtoken": "9.0.1",
"jsonwebtoken": "9.0.2",
"leaflet": "1.9.4",
"luxon": "3.4.0",
"marked": "4.3.0",
"luxon": "3.4.3",
"marked": "9.0.3",
"mime-types": "2.1.35",
"mongodb": "5.7.0",
"mongodb": "6.1.0",
"morgan": "1.10.0",
"multiparty": "4.2.3",
"node-syntaxhighlighter": "0.8.1",
"nodemailer": "6.9.4",
"nodemailer": "6.9.5",
"openidconnect-for-passport": "0.0.3",
"passport": "0.6.0",
"passport-github": "1.1.0",
Expand All @@ -69,14 +69,14 @@
"select2": "4.1.0-rc.0",
"select2-bootstrap-5-theme": "1.3.0",
"serve-favicon": "2.5.0",
"sharp": "0.32.4",
"sharp": "0.32.6",
"simple-configure": "0.1.6",
"simple-timepicker": "1.1.1",
"superagent": "8.0.9",
"superagent": "8.1.2",
"tinycolor2": "1.6.0",
"tinygradient": "1.1.5",
"useragent": "2.3.0",
"uuid": "9.0.0",
"uuid": "9.0.1",
"winston": "3.10.0"
},
"devDependencies": {
Expand Down Expand Up @@ -107,11 +107,11 @@
"karma-sinon": "1.0.5",
"mocha": "10.2.0",
"must-dist": "0.12.0",
"prettier": "3.0.1",
"prettier": "3.0.3",
"proxyquire": "2.1.3",
"puppeteer": "21.0.3",
"sass": "1.65.1",
"sinon": "15.2.0",
"puppeteer": "21.3.6",
"sass": "1.68.0",
"sinon": "16.0.0",
"supertest": "6.3.3"
},
"scripts": {
Expand Down
9 changes: 3 additions & 6 deletions softwerkskammer/lib/persistence/persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ module.exports = function persistenceFunc(collectionName) {
logInfo("Connecting to Mongo");
try {
logInfo("In connect callback");
const client = await MongoClient.connect(conf.get("mongoURL"), {
useNewUrlParser: true,
useUnifiedTopology: true,
});
const client = await MongoClient.connect(conf.get("mongoURL"));
var db = client.db("swk");
ourDB = db;
ourClient = client;
Expand Down Expand Up @@ -129,13 +126,13 @@ module.exports = function persistenceFunc(collectionName) {
{ $set: object },
{ new: true, upsert: false },
);
if (!newObject.value) {
if (!newObject) {
// something went wrong: restore old version count
object.version = oldVersion;
throw new Error(CONFLICTING_VERSIONS);
}
//logger.info(object.constructor.name + ' found and modified: ' + JSON.stringify(object));
return newObject.value;
return newObject;
} else {
// object is not yet persisted
return self.saveMongo(object);
Expand Down
Loading

0 comments on commit 88eb209

Please sign in to comment.