add pfps, some polish

This commit is contained in:
biglyderv 2024-11-25 14:12:44 -05:00
parent 351b9f2bc8
commit 85b3e55e3d
16 changed files with 142 additions and 230 deletions

18
client/settings.js Normal file
View file

@ -0,0 +1,18 @@
import Route from "../route.js";
import auth from "../form/auth.js";
// TODO: rewrite
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
return res.render('form', {
data: [
{ label: "Description", type: "textarea", name: "desc" },
{ label: "Avatar", type: "file", name: "file" }
],
'route': '/api/upload/settings',
'title': 'User Settings',
username
}); /* todo: form in not a file */
});
export default main;

View file

@ -18,12 +18,17 @@ let main = new Route([comment], async function (req, res, input) {
req.query.id
]);
let user = await db.all('SELECT * FROM user WHERE username = ?', [
req.query.id
]);
return res.render('user', {
...input,
id,
videos,
followers,
following
following,
user
});
});