diff options
Diffstat (limited to 'src/web/_views/modal/new_post.php')
-rw-r--r-- | src/web/_views/modal/new_post.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/web/_views/modal/new_post.php b/src/web/_views/modal/new_post.php index 66cb8c8..50b9b84 100644 --- a/src/web/_views/modal/new_post.php +++ b/src/web/_views/modal/new_post.php @@ -31,18 +31,18 @@ <script> $('#new-post-form').submit(function(e) { e.preventDefault(); - var content = $('#new-post-content').val(); - var me = $(this); + let content = $('#new-post-content').val(); + let me = $(this); - var getPost = function(data) { + const getPost = function(data) { if (data) { $('#post-container').prepend(data); } me.closest('.modal-container').remove(); } - var onPost = function(data) { - var id = data[0].id; + const onPost = function(data) { + let id = data[0].id; $.get({ url: '/_util/post/post?id=' + id, success: getPost @@ -52,7 +52,7 @@ $.ajax({ url: '/api/post', method: 'POST', - data: JSON.stringify({ content: content }), + data: JSON.stringify({ content }), success: onPost }); }); |