Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 24e014e

Browse files
committed
add tts to config
1 parent 0d80b48 commit 24e014e

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports.up = async db => {
2+
await db.schema.table('user_configs', table => {
3+
table.jsonb('tts').notNullable().defaultTo('{}');
4+
});
5+
};
6+
7+
module.exports.down = async db => {
8+
await db.schema.table('user_configs', table => {
9+
table.dropColumn('tts');
10+
});
11+
};
12+
13+
module.exports.configuration = { transaction: true };

gateway/src/routes/config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ router.get('/config', async (req, res) => {
1717
.where({
1818
'users.id': req.user.id,
1919
})
20-
.select('user_configs.ui', 'user_configs.analytics')
20+
.select('user_configs.ui', 'user_configs.analytics', 'user_configs.tts')
2121
.first()) || {
2222
ui: {},
2323
analytics: {},
24+
tts: {},
2425
};
2526
res.status(200).send(config);
2627
} catch (error) {
@@ -42,6 +43,9 @@ router.post('/config', async (req, res) => {
4243
lineHeight: 'number',
4344
letterSpacing: 'number',
4445
},
46+
tts: {
47+
speed: 'number',
48+
},
4549
};
4650
Object.keys(body).forEach(key => {
4751
if (allowedKeys[key]) {
@@ -69,7 +73,7 @@ router.post('/config', async (req, res) => {
6973
.where({
7074
'users.id': req.user.id,
7175
})
72-
.select('user_configs.ui', 'user_configs.analytics')
76+
.select('user_configs.ui', 'user_configs.analytics', 'user_configs.tts')
7377
.first();
7478
res.status(200).send(config);
7579
} catch (error) {

0 commit comments

Comments
 (0)