mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-23 04:10:40 +03:00
12 lines
No EOL
361 B
JavaScript
12 lines
No EOL
361 B
JavaScript
const { User, Thread } = require("../../classes/index");
|
|
|
|
|
|
module.exports = (req, res) => {
|
|
if (!req.session.loggedin) return res.redirect('/login');
|
|
|
|
const info = req.body;
|
|
const thread = new Thread(info.title, info.content, new User().getId(req.session.userid)).takeId();
|
|
thread.write()
|
|
res.redirect('/threads/' + thread.id);
|
|
|
|
} |