mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -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
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const logger = require("../lib/logger");
|
const logger = require('../lib/logger')
|
||||||
const models = require('../lib/models')
|
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 () {
|
async function cleanup () {
|
||||||
await models.Note.findAll({
|
await models.Note.findAll({
|
||||||
|
@ -20,7 +20,8 @@ async function cleanup() {
|
||||||
await models.Note.destroy({
|
await models.Note.destroy({
|
||||||
where: {
|
where: {
|
||||||
id: item.id
|
id: item.id
|
||||||
}})
|
}
|
||||||
|
})
|
||||||
await models.Revision.destroy({
|
await models.Revision.destroy({
|
||||||
where: {
|
where: {
|
||||||
noteId: item.id
|
noteId: item.id
|
||||||
|
@ -49,7 +50,8 @@ async function cleanup() {
|
||||||
await models.Author.destroy({
|
await models.Author.destroy({
|
||||||
where: {
|
where: {
|
||||||
id: item.id
|
id: item.id
|
||||||
}})
|
}
|
||||||
|
})
|
||||||
logger.info(`Deleted authorship ${item.id} from user ${item.userId}`)
|
logger.info(`Deleted authorship ${item.id} from user ${item.userId}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +71,8 @@ async function cleanup() {
|
||||||
await models.Author.destroy({
|
await models.Author.destroy({
|
||||||
where: {
|
where: {
|
||||||
id: item.id
|
id: item.id
|
||||||
}})
|
}
|
||||||
|
})
|
||||||
logger.info(`Deleted authorship ${item.id} from note ${item.noteId}`)
|
logger.info(`Deleted authorship ${item.id} from note ${item.noteId}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +92,8 @@ async function cleanup() {
|
||||||
await models.Revision.destroy({
|
await models.Revision.destroy({
|
||||||
where: {
|
where: {
|
||||||
id: item.id
|
id: item.id
|
||||||
}})
|
}
|
||||||
|
})
|
||||||
logger.info(`Deleted revision ${item.id} from note ${item.userId}`)
|
logger.info(`Deleted revision ${item.id} from note ${item.userId}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue