Skip to content

Commit

Permalink
Apply fix for PATCH as well
Browse files Browse the repository at this point in the history
  • Loading branch information
anvmn committed Oct 15, 2024
1 parent 8e00063 commit 686e351
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/src/js/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@
// tables that may be altered due to a change. In this case
// We want to allow adding pending upload photos.
// See for example dbSync.nodeChanges.hook().
return db.transaction('rw', table, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() {
var tableName = table.name;
return db.transaction('rw', tableName, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() {
return table.get(uuid).catch(databaseError).then(function (node) {
if (node) {
var body = JSON.stringify({
Expand Down Expand Up @@ -274,7 +275,7 @@
var changeTable = dbSync.nodeChanges;
var addShard = Promise.resolve();

if (table === dbSync.shards) {
if (tableName === 'shards') {
changeTable = dbSync.shardChanges;

addShard = table.get(uuid).catch(databaseError).then(function (item) {
Expand Down Expand Up @@ -343,7 +344,7 @@
return addShard.then(function (json) {
return table.put(json).catch(databaseError).then(function () {
return sendRevisedNode(table, uuid).then(function () {
var tableName = table.name;
var tableName = table.name;
// For hooks to be able to work, we need to declare the
// tables that may be altered due to a change. In this case
// We want to allow adding pending upload photos.
Expand Down

0 comments on commit 686e351

Please sign in to comment.