mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Merge pull request #305 from ErikMichelson/fix/eslint
Fixed eslint errors in cleanup-script
This commit is contained in:
commit
9425caf6c3
1 changed files with 23 additions and 19 deletions
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…
Add table
Add a link
Reference in a new issue