1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-22 01:47:08 +02:00

chore(server): move commands (#8121)

move commands
This commit is contained in:
Daniel Dietzler 2024-03-20 21:25:33 +01:00 committed by GitHub
parent 96a22ec3c1
commit 2dcce03352
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 19 deletions

View File

@ -1,6 +1,6 @@
import { Command, CommandRunner } from 'nest-commander';
import { UserService } from 'src/domain/user/user.service';
import { CLI_USER } from 'src/immich-admin/constants';
import { UserEntity } from 'src/infra/entities/user.entity';
@Command({
name: 'list-users',
@ -13,7 +13,16 @@ export class ListUsersCommand extends CommandRunner {
async run(): Promise<void> {
try {
const users = await this.userService.getAll(CLI_USER, true);
const users = await this.userService.getAll(
{
user: {
id: 'cli',
email: 'cli@immich.app',
isAdmin: true,
} as UserEntity,
},
true,
);
console.dir(users);
} catch (error) {
console.error(error);

View File

@ -1,12 +1,9 @@
import { Module } from '@nestjs/common';
import { ListUsersCommand } from 'src/commands/list-users.command';
import { DisableOAuthLogin, EnableOAuthLogin } from 'src/commands/oauth-login';
import { DisablePasswordLoginCommand, EnablePasswordLoginCommand } from 'src/commands/password-login';
import { PromptPasswordQuestions, ResetAdminPasswordCommand } from 'src/commands/reset-admin-password.command';
import { DomainModule } from 'src/domain/domain.module';
import { ListUsersCommand } from 'src/immich-admin/commands/list-users.command';
import { DisableOAuthLogin, EnableOAuthLogin } from 'src/immich-admin/commands/oauth-login';
import { DisablePasswordLoginCommand, EnablePasswordLoginCommand } from 'src/immich-admin/commands/password-login';
import {
PromptPasswordQuestions,
ResetAdminPasswordCommand,
} from 'src/immich-admin/commands/reset-admin-password.command';
import { InfraModule } from 'src/infra/infra.module';
@Module({

View File

@ -1,10 +0,0 @@
import { AuthDto } from 'src/domain/auth/auth.dto';
import { UserEntity } from 'src/infra/entities/user.entity';
export const CLI_USER: AuthDto = {
user: {
id: 'cli',
email: 'cli@immich.app',
isAdmin: true,
} as UserEntity,
};