add pfps, some polish
This commit is contained in:
parent
351b9f2bc8
commit
85b3e55e3d
16 changed files with 142 additions and 230 deletions
18
client/settings.js
Normal file
18
client/settings.js
Normal 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;
|
|
@ -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
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue