-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2862fed
commit 3a2526d
Showing
102 changed files
with
2,357 additions
and
5,115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ database.connect().then(async function () { | |
console.log('Migrated accounts'); | ||
|
||
process.exit(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,41 @@ | ||
const { confirm, input } = require('@inquirer/prompts'); | ||
const { connect } = require('./dist/database'); | ||
const { PNID } = require('./dist/models/pnid'); | ||
const { confirm, input } = require('@inquirer/prompts'); | ||
|
||
async function bootstrap() { | ||
await connect(); | ||
|
||
const pnidName = await input({ message: 'What PNID do you want to delete?' }); | ||
const pnid = await PNID.findOne({ username:pnidName.trim() }); | ||
if (!pnid) { | ||
console.log("Could not find PNID"); | ||
process.exit(1); | ||
} | ||
|
||
console.log('Before:', pnid); | ||
|
||
if (pnid.deleted) { | ||
console.log("PNID is already marked as deleted"); | ||
process.exit(1); | ||
} | ||
|
||
const confirmed = await confirm({ message: 'Do you want to delete this PNID',default: false }); | ||
if (!confirmed) { | ||
console.log("Aborted"); | ||
process.exit(1); | ||
} | ||
|
||
await pnid.scrub(); | ||
await pnid.save(); | ||
|
||
console.log('After:', pnid); | ||
if (pnid.deleted) console.log("SUCCESSFULLY DELETED"); | ||
else console.log("COULD NOT DELETE"); | ||
|
||
process.exit(0); | ||
await connect(); | ||
|
||
const pnidName = await input({ message: 'What PNID do you want to delete?' }); | ||
const pnid = await PNID.findOne({ username: pnidName.trim() }); | ||
if (!pnid) { | ||
console.log('Could not find PNID'); | ||
process.exit(1); | ||
} | ||
|
||
console.log('Before:', pnid); | ||
|
||
if (pnid.deleted) { | ||
console.log('PNID is already marked as deleted'); | ||
process.exit(1); | ||
} | ||
|
||
const confirmed = await confirm({ message: 'Do you want to delete this PNID', default: false }); | ||
if (!confirmed) { | ||
console.log('Aborted'); | ||
process.exit(1); | ||
} | ||
|
||
await pnid.scrub(); | ||
await pnid.save(); | ||
|
||
console.log('After:', pnid); | ||
if (pnid.deleted) { | ||
console.log('SUCCESSFULLY DELETED'); | ||
} else { | ||
console.log('COULD NOT DELETE'); | ||
} | ||
|
||
process.exit(0); | ||
} | ||
|
||
bootstrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.