Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewyatesg committed Apr 8, 2018
2 parents a6d29c9 + 2e720ab commit 3bdd6cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions routes/create/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = {
middleware: [upload.single("attachment")],
fn: function (req, res, next) {
console.log(req.file);
let board = req.body.board,
let name = req.body.name,
board = req.body.board,
attachment = req.file,
pinned = req.body.pinned | false,
ip = req.connection.remoteAddress,
Expand All @@ -26,14 +27,15 @@ module.exports = {
return next(new Error('Thread with that title already exists.'));
}
let thread = new Thread({
name: name,
boardId: board,
pinned: pinned,
ip: ip,
content: content,
title: title
});

let target_path;
let target_path;
if (attachment) {
target_path = path + attachment.filename + "." + attachment.originalname.split('.').pop();
thread.attachment_path = target_path;
Expand All @@ -60,6 +62,7 @@ module.exports = {

res.json({
result: {
name: name,
board: board,
attachment_name: attachment.originalname,
attachment_path: target_path,
Expand All @@ -73,6 +76,7 @@ module.exports = {
} else {
res.json({
result: {
name: name,
board: board,
content: content,
title: title,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Thread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
:src="'/' + thread.attachment_path">
</a></div>
<div class="postInfo"><span class="subject">{{ thread.title }}</span> <span class="nameBlock"> <span
class="name">Anonymous</span> </span> <span class="dateTime"
class="name">{{ thread.name }}</span> </span> <span class="dateTime"
data-utc="1523057718{INSERT}">{{ new Date(thread.timeStamp) }}</span>
<span class="postNum"> <a href="#{ID}" title="Link to this post">No.</a> <a
href="{JS FOR APPENDING ID TO REPLY}"
Expand All @@ -41,7 +41,7 @@
<div class="fileText"> File: <a :href="'/' + reply.attachment_path">{{ reply.attachment_name }}</a></div>
<a class="fileThumb" :href="'/' + reply.attachment_path" target="_blank"> <img :src="'/' + reply.attachment_path"> </a>
</div>
<div class="postInfo"><span class="nameBlock"> <span class="name">Anonymous</span> </span> <span
<div class="postInfo"><span class="nameBlock"> <span class="name">{{ reply.name }}</span> </span> <span
class="dateTime" data-utc="1523057718{INSERT}">{{ new Date(reply.time) }}</span> <span
class="postNum"> <a href="#{ID}" title="Link to this post">No.</a> <a
href="{JS FOR APPENDING ID TO REPLY}" title="Reply to this post">{{ reply._id }}</a> </span>
Expand Down

0 comments on commit 3bdd6cd

Please sign in to comment.