X-Git-Url: http://git.squeep.com/?p=websub-hub;a=blobdiff_plain;f=src%2Fdb%2Fpostgres%2Findex.js;h=2eca12f4909799f6d60ab2249d79d47a3cb4e6e1;hp=34511102ec5a0e596d0408e2a2bb8bfedeb94eab;hb=1d571ced238ac89098fa690bd35f5c9f58cb18f2;hpb=e5c67776b7a31daac84b5a047f9e566657e5b7f9 diff --git a/src/db/postgres/index.js b/src/db/postgres/index.js index 3451110..2eca12f 100644 --- a/src/db/postgres/index.js +++ b/src/db/postgres/index.js @@ -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;