inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

common.service 의 cursorPaginate 일반화 할때 nextUrl 생성시 질문입니다.

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

common.service 의 cursorPaginate 일반화 관련 질문입니다. nextUrl 생성할 때 아래와 같이 searchParams 를 생성하는데 이 부분은 일반화 할 수없는건가요? if (nextUrl) { for (const key of Object.keys(dto)) { if (dto[key]) { if ( key !== 'where__id__more_than' && key !== 'where__id__less_than' ) { nextUrl.searchParams.append(key, dto[key]); } } } let key = null; if (dto.order__createdAt === 'ASC') { key = 'where__id__more_than'; } else { key = 'where__id__less_than'; } nextUrl.searchParams.append(key, lastItem.id.toString()); }

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
Moon 댓글 3 좋아요 0 조회수 404

css 회원가입 실습 질문있습니다!

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요! 강의 수강 시작하고 지금 싸이월드 실습 막 시작한 학생입니다. 다름이 아니라 회원가입 부분 실습 마지막 몇 부분을 남기고 막혀서 모범코드(?) 같은걸 확인하고 싶은데, 학습자료 부분에가도 싸이월드 코드랑 피그마 링크만 안내되어있고 회원가입코드는 안보여서요! 일단 이렇게 이미지로 질문을 드려봅니다. 남성/여성 라디오버튼을 크기맞추고 가운데정렬까지 했는데 텍스트가 이렇게 세로로 정렬되어 버립니다. 체크박스버튼은 어떻게 손을봐야 할지 모르겠습니다 ㅜ

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
고경택 댓글 2 좋아요 0 조회수 361

postgresql 연결실패

해결됨

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

docker-compose.yml파일에 아래와같이 작성했습니다. 포트번호를 5808로 지정해준 이유는 5432로 지정해서 접속했을때 현재 pc에 설치했던 postgresql과 충돌이 나서 로그인이 안돼서 바꾸어 주었습니다. 도커 컴포즈 실행후 postgresql 컨테이너는 정상적으로 실행이 됐으나 nest앱과 postgresql explorer에서도 연결이 되지 않았습니다. 어떻게 해결해야하는지 질문드립니다 # 서비스정의 services: postgres: image: postgres:15 # 실행시마다 재시작 restart: always # 도커컴포즈 파일에 존재하는 위치에 실제 데이터를 hostOS에 저장 volumes: # 현재 도커컴포즈 파일이 존재하는 경로 : 이미지안에존재하는 경로 매핑 - ./postgres-data:/var/lib/postgresql/data ports: #hostport:이미지의포트 #5432포트 요청 -> 이미지의 포트로 요쳥 - '5808:5432' environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: '1111' POSTGRES_DB: postgres import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; import { PostsModule } from './posts/posts.module'; import { TypeOrmModule } from '@nestjs/typeorm'; import { PostsModel } from './posts/entities/posts.entity'; @Module({ //다른 모듈을 등록 //forRoot메서드는 typrorm과 nestjs와 연결할떄 사용 (DB) imports: [ PostsModule, TypeOrmModule.forRoot({ //데이터베이스 타입 type: 'postgres', host: '127.0.0.1', port: 5808, username: 'postgres', password: '1111', database: 'postgres', //entities폴더에 작성한 PostsModel 가져오기 entities: [PostsModel], synchronize: true, }), ], controllers: [AppController], providers: [AppService], }) export class AppModule {}

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
ystar5008 댓글 2 좋아요 0 조회수 888

해당 강의와 무관한 질문인데

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

혹시 2편은 언제 올라 오나요? ㅎㅎ 바로 구매 하고 싶습니다

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
rhkdtjd_12 댓글 1 좋아요 0 조회수 280

RS232c Serial 통신 관련 질문이 있습니다.

미해결

안녕하세요 연구실에서 자체적으로 실험기기와 컴퓨터랑 통신을 진행하는 중인데, 하나가 해결이 안 되어서 너무 답답해서 고수님들께 자문을 구하려고 합니다. Rs232 rtu 모드를 지원한다고 한 OS-20 overhead stirrer과 통신을 진행 중 입니다. 이 친구의 통신 규격과 방식은 아래 그림 3개와 같습니다. 이중 stirrer control 부분을 제가 참조해서 저 command를 hex 방식으로 입력하였는데 도무지 안되는 겁니다. 그런데 웃긴게 이 회사에서 지원하는 공식 통신프로그램을 사용하면 작동이 잘 되더군요. Instruction overview에서 나온 규칙은 다음과 같습니다. Command 구조는 Prefix Instruction_code Data_frame Checksum로 되어 있고 입력의 prefix는 0xfe로 시작하며 responce는 0xfd로 시작합니다. 모든 바이트 사이에는 50ms delay가 존재해야하며 Dataframe은 큰 수 자리부터 전송합니다. ex) 1000rpm을 data frame에 입력하려고 할 시 Hex값이 03E8이니까 앞에 두 자리를 0x03에 해당하고 뒤에 두 자리를 0xE8로 해당시킵니다. Null은 0x00입니다. Checksum 방식은 0xfe,0xfd인 prefix를 제외하고 나머지를 전부 더한 값으로 0xnn 이런식으로 표현됩니다. 신기하게도 16진수의 2자리를 넘어가도 뒤에 2 자리만 붙이면 된다고 하더군요. ex) 0xfe 0xb1 0x03 0xe8 0x00 checksum인데 0xfe를 제외하고 다 더하면 019c이지만 0x9c만 입력하면 되는 형식입니다. 그래서 이 규칙대로 코드를 짜서 통신을 해 보았는데, 아무리 해도 안되어서 너무 답답합니다. 심지어 제가 잘못했는지 확인하려고 시리얼 통신 sniffer을 사용하여서 공식 프로그램에서는 어떻게 통신이 되나 뜯어보았습니다. 결과는 아래 사진과 같습니다. 제가 python으로 작성한 코드는 아래와 같습니다. import serial import time ser = serial.Serial( port='COM7', # Update with your actual port baudrate=9600, parity=serial.PARITY_NONE, # No parity stopbits=serial.STOPBITS_ONE, # 1 stop bit bytesize=serial.EIGHTBITS # 8 data bits ) def send_hex_string(hex_string): # Convert the hex string to bytes byte_data = bytes.fromhex(hex_string) # Send the bytes over the serial port ser.write(byte_data) def send_hex_string_with_delay(hex_string, delay_ms=50): for i in range(0, len(hex_string), 2): # Extract each pair of characters and convert to bytes hex_pair = hex_string[i:i + 2] byte_data = bytes.fromhex(hex_pair) # Send the bytes over the serial port ser.write(byte_data) # Wait for the specified delay time.sleep(delay_ms / 1000.0) command = 'feb103e8009c' send_hex_string_with_delay(command) ser.close() 또한 파이썬에서의 결과를 시리얼 전송으로 보면 다음과 같습니다. 입력은 제대로 되는데 기기에는 반응이 제대로 나오지 않네요... 제가 잘못하고 빠뜨린 점이 있을까요? 읽어주셔서 정말 감사드립니다.

  • rs232
  • serial
  • 커뮤니케이션
  • python
전성훈 댓글 1 좋아요 1 조회수 1023

실제 프로젝트나 현업에서 primary key로 uuid를 사용하지 않아도 괜찮은가요?

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

uuid를 사용하지 않으면 id 값이 너무 단순해 보이는데 값이 쉽게 예측됨으로써 발생하는 보안 문제는 없을까요..? 실제 현업에서는 uuid를 사용하는지 사용하지 않는지 궁금하네요.. 그리고 uuid를 more than을 통해 값을 비교햐여 pagination을 구현하는 것이 가능한가요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
purnsup90 댓글 1 좋아요 0 조회수 598

저만 이런 에러 뜨는건지 모르겠는데, 영상 안나와서

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

해당 영상도 또 안나와서 이상해서 개발자도구 켜보니까 /course/lecture?courseSlug=nestjs-%EB%B0%B1%EC%97%94%EB%93%9C-%EC%99%84%EC%A0%84%EC%A0%95%EB%B3%B5-%EB%A7%88%EC%8A%A4%ED%84%B0-%ED%81%B4%EB%9E%98%EC%8A%A4-1&unitId=184136:1 Access to fetch at 'https://vod.inflearn.com/key/9d2b2df0-4061-42e6-a634-42fb7a946b91/68?key=d6303460076ac117c072323d06f3d269d6bd8dfde7e4a95ba3292cce2fdc879 f' from origin 'https://www.inflearn.co m' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. vod.inflearn.com/key/9d2b2df0-4061-42e6-a634-42fb7a946b91/68?key=d6303460076ac117c072323d06f3d269d6bd8dfde7e4a95ba3292cce2fdc879f:1 Failed to load resource: net::ERR_FAILED 인프런 자체 에러가 같은데 원인을 모르겠습니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
rhkdtjd_12 댓글 2 좋아요 0 조회수 638

0:41초부터 무한 로딩 되면서 영상 이 안나오네요.

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

제 인터넷 문제인줄 알았으나, 영상이 문제 인것 같습니다. 0:41초 되면 안나옵니다. 다른 영상들은 문제 없이 잘나옵니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
rhkdtjd_12 댓글 1 좋아요 0 조회수 312

안녕하세요 강의 코드에 대해 질문이 있습니다.

미해결

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요 강의를 만족하며 보고있습니다. 제가 강의를 수강하면서 모르는 부분만 보거나, 필요한 내용들을 그때마다 찾아서 공부하고 있습니다. 하지만 강의가 차례로, 순서대로 해야만 학습 가능한 부분들이있어 공부 하기가 어려운 점이 많습니다. 또 전체적인 코드로 한눈에 흐름을 파악하여 해당 강의 내용을 보고 싶을 때도 많은데, 차례로 강의를 따라가야지만 전체를 볼 수 있기 때문에 어렵습니다. 그래서 세션을 공부하기 위한 베이스 코드나, 강의를 하고 난 완료된 코드를 받고 싶은데 부탁드리겠습니다. 감사합니다.

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
inin 댓글 2 좋아요 2 조회수 266

postgres DB 연결 이슈

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

계속 postgres 디비 연결하는데 문제가 발생해서요. 해결 방법 알수 있을까요? 다른 비슷한 질문들 보고 port도 변경해 봤는데 [Nest] 4160 - 2023. 12. 12. 오전 10:14:32 ERROR [ExceptionHandler] Entity metadata for UsersModel#postComments was not found. Check if you specified a correct entity object and if it's connected in the connection options. TypeORMError: Entity metadata for UsersModel#postComments was not found. Check if you specified a correct entity object and if it's connected in the connection options. 계속 이렇게 에러가 나서요. 현재 port ‘5433:5432’ 로 연결하고 있습니다. 자세한 방법 부탁드립니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
호박인절미 댓글 4 좋아요 0 조회수 810

강의 자료 부탁드립니다!

미해결

프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)

안녕하세요. 강의 자료 요청합니다. elel3418@daum.net 감사합니다!

  • python
댓글 1 좋아요 0 조회수 216

다중 로그인을 막고 싶다면 추가로 어떻게 구현하는 것이 좋을까요?

해결됨

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

안녕하세요! 현재 구현된 로직 상에서는 연속으로 여러번 로그인 리퀘스트를 보내더라도 모든 accessToken으로 인증을 통과하는게 가능하던데 다중 로그인을 막고 싶은 경우 어떠한 점을 고려하면 좋을 지 강사님께서 추천하시는 방법이 있을까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
jhreplay.lee 댓글 1 좋아요 0 조회수 327

print 출력

미해결

프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)

선생님처럼 깔끔하게 괄호 안에 있는 부분만 뜨는 게 아니라 저 파란 줄로 길게 뜨는 건 왜 그런 건가요? 어떻게 하면 없앨 수 있나요?

  • python
hjy648012 댓글 2 좋아요 0 조회수 324

배열

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

배열 안에 자료형이 여러가지 된 숫자, 문자열 , 볼린 값들을 저장이 가능합니까?

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
navruzbek-1998_ 댓글 2 좋아요 0 조회수 201

노션 링크 어디에 있나요?

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

아무리 찾아봐도 링크 주소를 찾지 못해서 링크 주소 올려주시면 감사드립니다.

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
corp.starcoex 댓글 1 좋아요 0 조회수 270

query 없이 mutation 만작성하면 오류가 난다?

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요~ 복습중 이상한 현상이 발생하여 질문드립니다~ 답변 주시면 감사하겠습니다~ 질문1.resolver 부분에서 boards() 부분의 주석 부분을 해제해야, 맨아래 3번 오류가 발생하지 않고, 정상 작동 합니다. Query 없이 Mutation 만작성하면 오류가 발생하는걸까요? 아래 코드와 같이 query 부분을 주석 처리 하면 왜 오류가 나는 걸까요? 질문2. 에러가 내가 작성한 파일의 어떤부분이 잘못됐다고, 알려주는건 없는 걸까요? 아래 에러 코드를 보면 내가 작성한 코드가 아닌 작성하지도 않은 설치 파일같은데서 error 정보가 나오는데, 저기를 열어봐야 할까요? GraphQLError: Query root type must be provided. at SchemaValidationContext.reportError (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\type\validate.js:73:7) 1.resolver import { Args, Mutation, Resolver } from '@nestjs/graphql'; import { BoardsService } from './boards.service'; import { CreateBoardInput } from './dto/create-board.input'; import { Board } from './entities/board.entity'; @Resolver() export class BoardsResolver { constructor(private readonly boardsService: BoardsService) {} // @Query(() => String) // boards(): string { // return this.boardsService.boards(); // } @Mutation(() => Board) createBoard( @Args('createBoardInput') createBoardInput: CreateBoardInput, // ): Promise<Board> { return this.boardsService.create({ createBoardInput }); } } 2.service import { Injectable } from '@nestjs/common'; import { Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; import { IBoardsServiceCreate } from './interfaces/boards-service.interface'; import { Board } from './entities/board.entity'; @Injectable() export class BoardsService { constructor( @InjectRepository(Board) private readonly boardsRepository: Repository<Board>, // ) {} // boards() { // return 'boards'; // } create({ createBoardInput }: IBoardsServiceCreate): Promise<Board> { return this.boardsRepository.save({ ...createBoardInput }); } } 3.error [ GraphQLError: Query root type must be provided. at SchemaValidationContext.reportError (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\type\validate.js:73:7) at validateRootTypes (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\type\validate.js:89:13) at validateSchema (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\type\validate.js:41:3) at graphqlImpl (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\graphql.js:60:63) at C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\graphql.js:23:43 at new Promise (<anonymous>) at graphql (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\graphql.js:23:10) at GraphQLSchemaFactory.create (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\schema-builder\graphql-schema.factory.js:50:65) at GraphQLSchemaBuilder.generateSchema (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql-schema.builder.js:35:52) at GraphQLSchemaBuilder.build (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql-schema.builder.js:22:31) { path: undefined, locations: undefined, extensions: [Object: null prototype] {} } ] C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\schema-builder\graphql-schema.factory.js:56 throw new schema_generation_error_1.SchemaGenerationError(errors); ^ Error: Schema generation error (code-first approach) at GraphQLSchemaFactory.create (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\schema-builder\graphql-schema.factory.js:56:23) at processTicksAndRejections (node:internal/process/task_queues:96:5) at GraphQLSchemaBuilder.generateSchema (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql-schema.builder.js:35:24) at GraphQLSchemaBuilder.build (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql-schema.builder.js:22:20) at GraphQLFactory.generateSchema (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql.factory.js:27:41) at GraphQLModule.onModuleInit (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql.module.js:109:27) at callModuleInitHook (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\core\hooks\on-module-init.hook.js:51:9) at NestApplication.callInitHook (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\core\nest-application-context.js:223:13) at NestApplication.init (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\core\nest-application.js:100:9) at NestApplication.listen (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\core\nest-application.js:169:33)

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
김주원 댓글 1 좋아요 0 조회수 352

port 5432 failed: recived invalid response to ssl negotiation

미해결

따라하며 배우는 NestJS

이런 오류메세지가 나오는데 방법좀 부탁드립니다. nestJS서버는 5432포트로 돌아가고 있습니다!!

  • postgresql
  • jwt
  • nestjs
  • typeorm
meyou1218 댓글 1 좋아요 0 조회수 803

에러 해결하고 데이터베이스 초기화하기 파트

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 코드팩토리 통합 링크 https://links.codefactory.ai 안녕하세요 혹시 원래 만든 postModel 인터페이스에서 export interface PostModel { id: number ; author: string ; title: string ; content: string ; likeCount: number ; commentCount: number ; } 이렇게 author가 string으로 되어있어서 오류가 나오는데 이건 어떻게 처리하나요? The expected type comes from property 'author' which is declared here on type 'DeepPartial<PostModel>' 터미널에서는 이렇게 오류가 나옵니다 타입 관련 오류인데 이게 아래에선 postmodel을 받는데 author을 authorId가 들어간 객체로 받는데 위에선 선언을 string으로 해줬는데 이것도 잘 이해가 안 갑니다.. async createPost(authorId: number , title: string , content: string) { // 1) create -> 저장할 객체를 생성한다. // 2) save -> 객체를 저장한다. (create 메서드에서 생성한 객체로) const post = this.postsRepository.create({ author: { id: authorId , } , title , content , likeCount: 0, commentCount: 0, }) ; const ne wPost = await this.postsR epository.save(post) ; return newPost ; }

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
채 수 댓글 1 좋아요 0 조회수 507

관계형 연결되어있는 DB 모델 삭제 시 에러 처리

해결됨

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

안녕하세요. 강의 잘 듣고 있습니다. image multer 적용 후, 몇가지 api를 테스트 하던중에 아래와 같은 에러가 발생하여, 해결하고자 시도를 해보았는데 잘 해결 되지 않아 질문 드립니다. 에러 메세지 QueryFailedError: update or delete on table "posts_model" violates foreign key constraint "FK_40cd89c6655ec7b102842feacab" on table "image_model" 에러 발생 상황 - image가 post 모델에 관계형이 지어있는 상황에서, post를 지우려고 하면 (deletePost API 사용) 위와 같은 에러 메세지가 나오며 에러가 발생합니다. 에러 해결을 위한 시도 - onDelete : "CASCADE" 옵션을 posts model에 주고, db를 초기화 한후 다시 시도해보았지만 같은 상황이 발생하였습니다. 해당 에러를 어떤식으로 해결해야할지 말씀 부탁드립니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
dhj100 댓글 1 좋아요 1 조회수 444

예외처리, 함수 Return type 관련하여 질문 드립니다!

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요! 수업 수강 중 궁금한 부분이 생겨 질문 드립니다! 질문 1) Section 11-01 수업 중 users.service.ts 에서 create 함수를 만들 때 const user = await this.findOneByEmail({ email }); if (user) throw new ConflictException('이미 등록된 이메일입니다.'); 위와 같이 email을 검사하고 이미 이메일이 있으면 예외처리를 해주게 되는데 Entity 구현 시 email에 { unique: true } 를 주어도 위 코드처럼 예외처리를 해주어야 하는건가요? 질문 2) Section 10의 products.service.ts 에서 create 함수를 만들 때 함수의 return type은 Promise<Product> 로 구현을 했는데, const result2 = this.productsRepository.save({ ...product, productSalesLocation: result, productCategory: { id: productCategoryId, // 만약 name 까지 받고 싶으면? // => createProductInput에 name까지 포함해서 받아오기 }, productTags: tags, }); return result2; 이런 식으로 result2 를 return 하게 되면 플레이그라운드에서 return 을 선택할 때 productCategory.name 까지 선택할 수 있게 되어 있더라구요. 주석에 쓰여진 내용처럼 name 을 받고 싶으면 createProductInput 에 name을 포함하면 되지만, 지금 처럼 id만 save할 경우, 프론트 개발자 또는 이 API 사용자에게는 productCategory.name 이 없다고 매 번 설명을 해야하는 번거로움이 있을 것 같은데 이런 경우 함수의 return type을 새로 정의하기도 하나요? ex) class ProductsServiceCreateReturn ...

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
00_3 댓글 2 좋아요 0 조회수 222

인기 태그

인프런 TOP Writers

주간 인기글