mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-26 21:30:42 +03:00
12 lines
361 B
JavaScript
12 lines
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);
|
||
|
|
||
|
}
|