mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
#319 profile schema v2 - further fixes
This commit is contained in:
parent
1ee749da9f
commit
e2fe67f127
1
Makefile
1
Makefile
@ -23,6 +23,7 @@ stop:
|
||||
deploy: install
|
||||
yarn build
|
||||
node server/migrate.js
|
||||
echo "\ncaches.keys().then(cs=>cs.forEach(c=>caches.delete(c)))" >> static/sw.js
|
||||
ln -sfn ../data/img ./static/img-local
|
||||
ln -sfn ../data/docs ./static/docs-local
|
||||
|
||||
|
@ -183,6 +183,11 @@ router.post('/profile/save', handleErrorAsync(async (req, res) => {
|
||||
req.body = upgradeToV2(req.body);
|
||||
}
|
||||
|
||||
if (!Array.isArray(req.body.customFlags)) {
|
||||
// no idea WTF is happening here, but somehow we got values like {"0": ..., "1": ..., ...}
|
||||
req.body.customFlags = Object.values(req.body.customFlags);
|
||||
}
|
||||
|
||||
// TODO just make it a transaction...
|
||||
const ids = (await req.db.all(SQL`SELECT * FROM profiles WHERE userId = ${req.user.id} AND locale = ${global.config.locale}`)).map(row => row.id);
|
||||
if (ids.length) {
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user