Need to parse the fields settings to make the date-format available in parsing, and set sql_mode in docker to make dates work even if they are not strict mysql-dates

This commit is contained in:
Gerhard Sletten 2019-12-12 15:39:44 +01:00
parent 7744f5dc29
commit 300f0977f6
3 changed files with 8 additions and 1 deletions

View file

@ -10,6 +10,7 @@ services:
- MYSQL_PASSWORD=mailtrain
volumes:
- mysql-data:/var/lib/mysql
command: mysqld --sql_mode=""
redis:
image: redis:5

View file

@ -10,6 +10,7 @@ services:
- MYSQL_PASSWORD=mailtrain
volumes:
- mysql-data:/var/lib/mysql
command: mysqld --sql_mode=""
redis:
image: redis:5

View file

@ -310,7 +310,12 @@ async function listTx(tx, listId) {
async function list(context, listId) {
return await knex.transaction(async tx => {
await shares.enforceEntityPermissionTx(tx, context, 'list', listId, ['viewFields']);
return await listTx(tx, listId);
const flds = await listTx(tx, listId);
return flds.map(fld => {
fld.settings = JSON.parse(fld.settings);
return fld;
});
});
}