projects
/
websub-hub
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix topic update integration test, topicGetByUrl now optionally applies defaults
[websub-hub]
/
src
/
db
/
sqlite
/
index.js
diff --git
a/src/db/sqlite/index.js
b/src/db/sqlite/index.js
index 56afa000cb886f900277e4bf819139b93e926707..76309d6c039f623749b575b2f1b1b20f9fb212e5 100644
(file)
--- a/
src/db/sqlite/index.js
+++ b/
src/db/sqlite/index.js
@@
-759,7
+759,7
@@
class DatabaseSQLite extends Database {
}
}
- topicGetByUrl(dbCtx, topicUrl) {
+ topicGetByUrl(dbCtx, topicUrl
, applyDefaults = true
) {
const _scope = _fileScope('topicGetByUrl');
this.logger.debug(_scope, 'called', { topicUrl });
const _scope = _fileScope('topicGetByUrl');
this.logger.debug(_scope, 'called', { topicUrl });
@@
-767,7
+767,10
@@
class DatabaseSQLite extends Database {
try {
topic = this.statement.topicGetByUrl.get({ topicUrl });
DatabaseSQLite._topicDataToNative(topic);
try {
topic = this.statement.topicGetByUrl.get({ topicUrl });
DatabaseSQLite._topicDataToNative(topic);
- 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;
} catch (e) {
this.logger.error(_scope, 'failed', { error: e, topic, topicUrl });
throw e;