Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add configuration section to README.ko #426

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,48 @@ export class UserModule {}
- `POST /users/search` - retrieves a list of users based on complex search criteria
- `POST /users/:id/recover` - recovers a soft deleted user by ID

## 구성

Crud 데코레이터는 아래와 같은 구성 옵션을 제공합니다:

### entity

(필수) 컨트롤러가 동작하기 위해서 TypeORM 엔티티가 필요합니다.

### routes

(선택) routes 옵션을 사용해서 각 Route에 대한 구성을 지정할 수 있습니다. 모든 Route에는 다음의 기본 옵션들이 있습니다.

```typescript
import { NestInterceptor, Type } from '@nestjs/common';

interface RouteBaseOption {
decorators?: Array<PropertyDecorator | MethodDecorator>;
interceptors?: Array<Type<NestInterceptor>>;
swagger?: {
hide?: boolean;
response?: Type<unknown>;
};
exclude?: string[];
}
```

그리고 각 Route들은 아래와 같은 고유한 옵션을 지닙니다.

(추가 예정)

### only

(선택) 생성할 Route에 대한 배열을 지정하여 해당 Route들만 생성되도록 구성할 수 있습니다. 만약 지정되지 않는다면 모든 Route가 생성됩니다.

예를 들어, CREATE/READ_ONE에 대해서만 생성하고 싶다면 아래와 같이 구성할 수 있습니다.

```typescript
import { Crud, Method } from '@nestjs-library/crud';

@Crud({ entity: User, only: [Method.CREATE, Method.READ_ONE] })
```

---

## [Contributors](https://github.com/type-challenges/type-challenges/graphs/contributors)
Expand Down
Loading