removed sourceId where it's not necessary (stored in CLS instead)

This commit is contained in:
azivner
2018-03-30 19:41:54 -04:00
parent 795d50f02e
commit 5d203b2278
16 changed files with 67 additions and 85 deletions

View File

@@ -62,13 +62,12 @@ async function getTree(req) {
async function setPrefix(req) {
const branchId = req.params.branchId;
const sourceId = req.headers.source_id;
const prefix = utils.isEmptyOrWhitespace(req.body.prefix) ? null : req.body.prefix;
await sql.doInTransaction(async () => {
await sql.execute("UPDATE branches SET prefix = ?, dateModified = ? WHERE branchId = ?", [prefix, utils.nowDate(), branchId]);
await sync_table.addBranchSync(branchId, sourceId);
await sync_table.addBranchSync(branchId);
});
return {};