diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index e087c81..ef69f7d 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -582,6 +582,14 @@ Ensure the default browser behavior of the `hidden` attribute. height: 9rem; } +.h-12 { + height: 3rem; +} + +.h-24 { + height: 6rem; +} + .max-h-40 { max-height: 10rem; } @@ -602,6 +610,14 @@ Ensure the default browser behavior of the `hidden` attribute. width: 100%; } +.w-12 { + width: 3rem; +} + +.w-24 { + width: 6rem; +} + .max-w-lg { max-width: 32rem; } diff --git a/routes/user.js b/routes/user.js index 01553a9..b8ca884 100644 --- a/routes/user.js +++ b/routes/user.js @@ -43,13 +43,22 @@ router.get('/settings', async function(req, res, next) { router.post('/settings', async function(req, res, next) { var sessionId = req.cookies.sessionid; var auth = await lib.getAuthUser(sessionId); + var newData = {}; + if(req.body.bio != '') { + newData.bio = req.body.bio; + } + if(req.body.name != '') { + newData.name = req.body.name; + } + if(req.files) { + if(req.files.avatar.data) { + newData.avatar = req.files.avatar.data; + } + } if(auth) { console.log(req); console.log(req.files); - await auth.update({ - 'bio': req.body.bio, - 'avatar': req.files.avatar.data, - }); + await auth.update(newData); res.redirect('/user/settings'); } else { res.redirect('/login'); diff --git a/views/index.ejs b/views/index.ejs index 617252e..39cb995 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -32,38 +32,14 @@