Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Replace post_id by page_id
Browse files Browse the repository at this point in the history
  • Loading branch information
ummels committed Mar 12, 2016
1 parent bb1041c commit 914e9b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Comments.prototype.submit = function(event) {
var email = event.email.trim().toLowerCase();
var homepage = parseUrl(event.url);
var name = event.name.trim();
var content = pack(event.postId, date, name, homepage, email, event.comment.trim());
var content = pack(event.pageId, date, name, homepage, email, event.comment.trim());
var commentId = date.format('YYYYMMDDTHHmmss');
var branch = 'comment-' + commentId;

Expand Down Expand Up @@ -48,9 +48,9 @@ Comments.prototype.submit = function(event) {
});
};

function pack(postId, date, name, homepage, email, comment) {
function pack(pageId, date, name, homepage, email, comment) {
return '---\n' +
'post_id: ' + postId + '\n' +
'page_id: ' + pageId + '\n' +
'date: ' + date.toISOString() + '\n' +
'name: ' + name + '\n' +
'homepage: ' + homepage + '\n' +
Expand Down
6 changes: 3 additions & 3 deletions comments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def self.load(comments)
@comments = Hash.new() { |h, k| h[k] = Array.new }

for comment in comments
@comments[comment['post_id']] << comment
@comments[comment['page_id']] << comment
end
end

def self.get(post_id)
@comments[post_id]
def self.get(page_id)
@comments[page_id]
end
end
2 changes: 1 addition & 1 deletion test_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "John Doe",
"email": "john@doe.com",
"url": "http://www.doe.com",
"postId": "/test",
"pageId": "/test",
"comment": "Howdie, how are you doing?"
}

0 comments on commit 914e9b6

Please # to comment.