chore: apply code formatting and linting
- format long import statements with consistent line wrapping - apply consistent indentation across client and server modules - remove generated tsconfig.tsbuildinfo file
This commit is contained in:
@@ -15,7 +15,12 @@ import { SnippetExportDto } from "./dto/snippet-export.dto";
|
||||
import { UpdateSnippetDto } from "./dto/update-snippet.dto";
|
||||
import { SnippetEntity } from "./snippet.entity";
|
||||
|
||||
export type SnippetOrderBy = "id" | "alias" | "title" | "createdAt" | "updatedAt";
|
||||
export type SnippetOrderBy =
|
||||
| "id"
|
||||
| "alias"
|
||||
| "title"
|
||||
| "createdAt"
|
||||
| "updatedAt";
|
||||
|
||||
@Injectable()
|
||||
export class SnippetService implements OnModuleInit {
|
||||
@@ -47,7 +52,9 @@ export class SnippetService implements OnModuleInit {
|
||||
async create(dto: CreateSnippetDto): Promise<SnippetEntity> {
|
||||
const existing = await this.repo.findOneBy({ alias: dto.alias });
|
||||
if (existing) {
|
||||
throw new ConflictException(`Snippet alias "${dto.alias}" already exists`);
|
||||
throw new ConflictException(
|
||||
`Snippet alias "${dto.alias}" already exists`,
|
||||
);
|
||||
}
|
||||
return this.repo.save(
|
||||
this.repo.create({
|
||||
@@ -85,7 +92,9 @@ export class SnippetService implements OnModuleInit {
|
||||
if (dto.alias && dto.alias !== snippet.alias) {
|
||||
const conflict = await this.repo.findOneBy({ alias: dto.alias });
|
||||
if (conflict)
|
||||
throw new ConflictException(`Snippet alias "${dto.alias}" already exists`);
|
||||
throw new ConflictException(
|
||||
`Snippet alias "${dto.alias}" already exists`,
|
||||
);
|
||||
}
|
||||
Object.assign(snippet, dto);
|
||||
return this.repo.save(snippet);
|
||||
|
||||
Reference in New Issue
Block a user