@@ -8,7 +8,7 @@ const { newCheckViewPermission, errorForbidden, responseCodiMD, errorNotFound, e
88const { updateHistory } = require ( '../history' )
99const { actionPublish, actionSlide, actionInfo, actionDownload, actionPDF, actionGist, actionRevision, actionPandoc } = require ( './noteActions' )
1010
11- async function getNoteById ( noteId , { includeUser } = { includeUser : false } ) {
11+ async function getNoteById ( noteId , { includeUser } = { includeUser : false } ) {
1212 const id = await Note . parseNoteIdAsync ( noteId )
1313
1414 const includes = [ ]
@@ -32,7 +32,7 @@ async function getNoteById(noteId, { includeUser } = { includeUser: false }) {
3232 return note
3333}
3434
35- async function createNote ( userId , noteAlias ) {
35+ async function createNote ( userId , noteAlias ) {
3636 if ( ! config . allowAnonymous && ! userId ) {
3737 throw new Error ( 'can not create note' )
3838 }
@@ -50,7 +50,7 @@ async function createNote(userId, noteAlias) {
5050}
5151
5252// controller
53- async function showNote ( req , res ) {
53+ async function showNote ( req , res ) {
5454 const noteId = req . params . noteId
5555 const userId = req . user ? req . user . id : null
5656
@@ -78,7 +78,7 @@ async function showNote(req, res) {
7878 return responseCodiMD ( res , note )
7979}
8080
81- function canViewNote ( note , isLogin , userId ) {
81+ function canViewNote ( note , isLogin , userId ) {
8282 if ( note . permission === 'private' ) {
8383 return note . ownerId === userId
8484 }
@@ -88,7 +88,7 @@ function canViewNote(note, isLogin, userId) {
8888 return true
8989}
9090
91- async function showPublishNote ( req , res ) {
91+ async function showPublishNote ( req , res ) {
9292 const shortid = req . params . shortid
9393
9494 const note = await getNoteById ( shortid , {
@@ -141,7 +141,7 @@ async function showPublishNote(req, res) {
141141 res . render ( 'pretty.ejs' , data )
142142}
143143
144- async function noteActions ( req , res ) {
144+ async function noteActions ( req , res ) {
145145 const noteId = req . params . noteId
146146
147147 const note = await getNoteById ( noteId )
@@ -189,7 +189,7 @@ async function noteActions(req, res) {
189189 }
190190}
191191
192- async function getMyNoteList ( userId , callback ) {
192+ async function getMyNoteList ( userId , callback ) {
193193 const myNotes = await Note . findAll ( {
194194 where : {
195195 ownerId : userId
@@ -217,7 +217,7 @@ async function getMyNoteList(userId, callback) {
217217 }
218218}
219219
220- function listMyNotes ( req , res ) {
220+ function listMyNotes ( req , res ) {
221221 if ( req . isAuthenticated ( ) ) {
222222 getMyNoteList ( req . user . id , ( err , myNoteList ) => {
223223 if ( err ) return errorInternalError ( req , res )
0 commit comments