per-browser source id so we support having notecase opened in multiple tabs/windows

This commit is contained in:
azivner
2017-12-16 20:48:34 -05:00
parent 03d86209ca
commit 50ff5da947
17 changed files with 98 additions and 83 deletions

View File

@@ -25,12 +25,13 @@ router.get('/', auth.checkApiAuth, async (req, res, next) => {
router.post('/', async (req, res, next) => {
const body = req.body;
const sourceId = req.headers.source_id;
if (ALLOWED_OPTIONS.includes(body['name'])) {
const optionName = await options.getOption(body['name']);
await sql.doInTransaction(async () => {
await options.setOption(body['name'], body['value']);
await options.setOption(body['name'], body['value'], sourceId);
});
res.send({});