mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(database): 🎨 Improve database handlers to have more consistent naming and methods
This commit is contained in:
parent
a6159b9d55
commit
5565bf00de
47 changed files with 365 additions and 333 deletions
|
|
@ -118,13 +118,13 @@ export default class UserCreate extends BaseCommand<typeof UserCreate> {
|
|||
!flags.format &&
|
||||
this.log(
|
||||
`${chalk.green("✓")} Created user ${chalk.green(
|
||||
user.getUser().username,
|
||||
user.data.username,
|
||||
)} with id ${chalk.green(user.id)}`,
|
||||
);
|
||||
|
||||
this.log(
|
||||
formatArray(
|
||||
[user.getUser()],
|
||||
[user.data],
|
||||
[
|
||||
"id",
|
||||
"username",
|
||||
|
|
@ -144,7 +144,7 @@ export default class UserCreate extends BaseCommand<typeof UserCreate> {
|
|||
flags.format
|
||||
? link
|
||||
: `\nPassword reset link for ${chalk.bold(
|
||||
`@${user.getUser().username}`,
|
||||
`@${user.data.username}`,
|
||||
)}: ${chalk.underline(chalk.blue(link))}\n`,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export default class UserDelete extends UserFinderCommand<typeof UserDelete> {
|
|||
flags.print &&
|
||||
this.log(
|
||||
formatArray(
|
||||
users.map((u) => u.getUser()),
|
||||
users.map((u) => u.data),
|
||||
[
|
||||
"id",
|
||||
"username",
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ export default class UserList extends BaseCommand<typeof UserList> {
|
|||
|
||||
this.log(
|
||||
formatArray(
|
||||
users.map((u) => u.getUser()),
|
||||
users.map((u) => u.data),
|
||||
keys,
|
||||
flags.format as "json" | "csv" | undefined,
|
||||
flags["pretty-dates"],
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export default class UserRefetch extends UserFinderCommand<typeof UserRefetch> {
|
|||
flags.print &&
|
||||
this.log(
|
||||
formatArray(
|
||||
users.map((u) => u.getUser()),
|
||||
users.map((u) => u.data),
|
||||
[
|
||||
"id",
|
||||
"username",
|
||||
|
|
@ -85,7 +85,7 @@ export default class UserRefetch extends UserFinderCommand<typeof UserRefetch> {
|
|||
this.log(
|
||||
chalk.bold(
|
||||
`${chalk.red("✗")} Failed to refetch user ${
|
||||
user.getUser().username
|
||||
user.data.username
|
||||
}`,
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ export default class UserReset extends UserFinderCommand<typeof UserReset> {
|
|||
flags.print &&
|
||||
this.log(
|
||||
formatArray(
|
||||
users.map((u) => u.getUser()),
|
||||
users.map((u) => u.data),
|
||||
[
|
||||
"id",
|
||||
"username",
|
||||
|
|
@ -108,7 +108,7 @@ export default class UserReset extends UserFinderCommand<typeof UserReset> {
|
|||
flags.raw
|
||||
? link
|
||||
: `\nPassword reset link for ${chalk.bold(
|
||||
`@${user.getUser().username}`,
|
||||
`@${user.data.username}`,
|
||||
)}: ${chalk.underline(chalk.blue(link))}\n`,
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue