Merge pull request #305 from ErikMichelson/fix/eslint
Fixed eslint errors in cleanup-script
This commit is contained in:
		
						commit
						9425caf6c3
					
				
							
								
								
									
										16
									
								
								bin/cleanup
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								bin/cleanup
									
									
									
									
									
								
							| @ -1,9 +1,9 @@ | ||||
| #!/usr/bin/env node | ||||
| 
 | ||||
| const logger = require("../lib/logger"); | ||||
| const logger = require('../lib/logger') | ||||
| const models = require('../lib/models') | ||||
| 
 | ||||
| logger.info("Cleaning up notes that should already have been removed. Sorry.") | ||||
| logger.info('Cleaning up notes that should already have been removed. Sorry.') | ||||
| 
 | ||||
| async function cleanup () { | ||||
|   await models.Note.findAll({ | ||||
| @ -20,7 +20,8 @@ async function cleanup() { | ||||
|         await models.Note.destroy({ | ||||
|           where: { | ||||
|             id: item.id | ||||
|         }}) | ||||
|           } | ||||
|         }) | ||||
|         await models.Revision.destroy({ | ||||
|           where: { | ||||
|             noteId: item.id | ||||
| @ -49,7 +50,8 @@ async function cleanup() { | ||||
|         await models.Author.destroy({ | ||||
|           where: { | ||||
|             id: item.id | ||||
|         }}) | ||||
|           } | ||||
|         }) | ||||
|         logger.info(`Deleted authorship ${item.id} from user ${item.userId}`) | ||||
|       } | ||||
|     } | ||||
| @ -69,7 +71,8 @@ async function cleanup() { | ||||
|         await models.Author.destroy({ | ||||
|           where: { | ||||
|             id: item.id | ||||
|         }}) | ||||
|           } | ||||
|         }) | ||||
|         logger.info(`Deleted authorship ${item.id} from note ${item.noteId}`) | ||||
|       } | ||||
|     } | ||||
| @ -89,7 +92,8 @@ async function cleanup() { | ||||
|         await models.Revision.destroy({ | ||||
|           where: { | ||||
|             id: item.id | ||||
|         }}) | ||||
|           } | ||||
|         }) | ||||
|         logger.info(`Deleted revision ${item.id} from note ${item.userId}`) | ||||
|       } | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user