X-Git-Url: http://git.squeep.com/?p=websub-hub;a=blobdiff_plain;f=src%2Fdb%2Fpostgres%2Findex.js;fp=src%2Fdb%2Fpostgres%2Findex.js;h=e70aeb7b7883e2700dceb7ce7599d069bf8a515c;hp=34511102ec5a0e596d0408e2a2bb8bfedeb94eab;hb=41ae00113d39abada54823b7133c473b8fb758f5;hpb=acf63f7913320f8edb9db9dc31d13ec7ff5d104f diff --git a/src/db/postgres/index.js b/src/db/postgres/index.js index 3451110..e70aeb7 100644 --- a/src/db/postgres/index.js +++ b/src/db/postgres/index.js @@ -377,7 +377,7 @@ class DatabasePostgres extends Database { throw new DBErrors.UnexpectedResult('did not upsert authentication'); } } catch (e) { - this.logger.error(_scope, 'failed', { error: e, identifier, scrubbedCredential }) + this.logger.error(_scope, 'failed', { error: e, identifier, scrubbedCredential }); throw e; } } @@ -789,14 +789,17 @@ class DatabasePostgres extends Database { } - async topicGetByUrl(dbCtx, topicUrl) { + async topicGetByUrl(dbCtx, topicUrl, applyDefaults = true) { const _scope = _fileScope('topicGetByUrl'); this.logger.debug(_scope, 'called', { topicUrl }); let topic; try { topic = await dbCtx.oneOrNone(this.statement.topicGetByUrl, { topicUrl }); - return this._topicDefaults(topic); + if (applyDefaults) { + topic = this._topicDefaults(topic); + } + return topic; } catch (e) { this.logger.error(_scope, 'failed', { error: e, topic, topicUrl }); throw e;