월 79,200원
5개월 할부 시다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
하나의 컨테이너에 api서버와 데이터서버를 같이 관리할 수 있나요?
강의에서는 api서버와 데이터베이스 서버를 각각의 컨테이너에서 관리하는걸 보여주셨는데 하나의 api서버와 데이터베이스서버를 같이 넣는것도 가능한지 궁금합니다.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
몽고디비 접속 문제
노션에 써있는걸로 sudo systemctl start mongod 실행하면 실행이 안되서공식문서에서 찾아보니 sudo service mongod start를 입력하면 starting database mongod 라고 뜬 후 fail이 뜹니다.... localhost:27017로 접속을 하면 잘 뜨긴 하는데 해결 방법이 없을까요 ??
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
도커내부 접속 안됨
docker run 이미지ID 하고 새로운 터미널 열어서 docker ps 로 containerID 확인 후docker exec -it 명령어 사용해서 도커 내부로 들어가려고 하면 OCI runtime exec failed: exec failed: unable to start container process: exec: "C:/Program Files/Git/usr/bin/bash": stat C:/Program Files/Git/usr/bin/bash: no such file or directory: unknown이런식으로 오류가 뜹니다 왜 그런건가요??해결 방법 알려주세요!
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
N:M tag 부분 구현 중 findOne 조회 부분 에러
products.service.ts에서 create 부근에 tag를 저장 하기 전 tag를 미리 조회하는 부분을 구현 중인데 findOne에서 {name: tagname} 을 구현하려고 할 때 다음과 같은 에러가 발생합니다. save에서는 에러가 발생하지 않는데 findOne 조회 부분만 에러가 발생하네요관련된 코드 같이 보내드립니다.createProduct.input.tsimport { InputType, Field, Int } from '@nestjs/graphql'; import { Min } from 'class-validator'; import { ProductSaleslocationInput } from 'src/apis/productsSaleslocation/entities/dto/productSaleslocation.input'; @InputType() export class CreateProductInput { @Field(() => String) name: string; @Field(() => String) description: string; @Min(0) @Field(() => Int) price: number; @Field(() => ProductSaleslocationInput) productSaleslocation: ProductSaleslocationInput; @Field(() => String) productCategotyId: string; @Field(() => [String]) productTags: string[]; } products.entity.tsimport { Field, Int, ObjectType } from '@nestjs/graphql'; import { ProductCategory } from 'src/apis/productsCategory/entities/productsCategory.entity'; import { ProductTag } from 'src/apis/productsTags/productTags.entity'; import { User } from 'src/apis/users/users.entity'; import { Column, DeleteDateColumn, Entity, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToOne, PrimaryGeneratedColumn, } from 'typeorm'; import { ProductSaleslocation } from '../../productsSaleslocation/entities/productsSaleslocation.entity'; @Entity() @ObjectType() export class Product { @PrimaryGeneratedColumn('uuid') @Field(() => String) id: string; @Field(() => String) @Column() name: string; @Field(() => String) @Column() description: string; @Field(() => Int) @Column() price: number; @Field(() => Boolean) @Column({ default: false }) isSoldout: boolean; @DeleteDateColumn() deletedAt: Date; @Field(() => ProductSaleslocation) @JoinColumn() @OneToOne(() => ProductSaleslocation) productSaleslocation: ProductSaleslocation; @Field(() => ProductCategory) @ManyToOne(() => ProductCategory) productCategory: ProductCategory; @Field(() => User) @ManyToOne(() => User) user: User; @JoinTable() @ManyToMany(() => ProductTag, (productTags) => productTags.products) @Field(() => [ProductTag]) productTags: ProductTag[]; } productTags.entity.tsimport { Field, ObjectType } from '@nestjs/graphql'; import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Product } from '../products/entities/products.entity'; @Entity() @ObjectType() export class ProductTag { @Field(() => String) @PrimaryGeneratedColumn('uuid') id: string; @Column() @Field(() => String) name: string; @Field(() => [Product]) @ManyToMany(() => Product, (products) => products.productTags) products: Product[]; } products.service.tsimport { Product } from './entities/products.entity'; import { Injectable, UnprocessableEntityException } from '@nestjs/common'; import { Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; import { ProductSaleslocation } from '../productsSaleslocation/entities/productsSaleslocation.entity'; import { ProductTag } from '../productsTags/productTags.entity'; @Injectable() export class ProductService { constructor( @InjectRepository(Product) private readonly productRepository: Repository<Product>, @InjectRepository(ProductSaleslocation) private readonly productSaleslocationRepository: Repository<ProductSaleslocation>, @InjectRepository(ProductTag) private readonly productTagRepository: Repository<ProductTag>, ) {} async findAll() { return await this.productRepository.find({ relations: ['productSaleslocation', 'productCategory', 'productTags'], }); } async findOne({ productId }) { return await this.productRepository.findOne({ where: { id: productId }, relations: ['productSaleslocation', 'productCategory', 'productTags'], }); } async create({ createProductInput }) { // 1. 상품만 등록하는 경우 // const result = await this.productRepository.save({ // ...createProductInput, // // 하나 하나 직접 나열하는 방식 // // name: createProductInput.name, // // description: createProductInput.description, // // price: createProductInput.price, // }); // 2. 상품과 상품거래 위치 같이 등록 const { productSaleslocation, productCategotyId, productTag, ...product } = createProductInput; const result = await this.productSaleslocationRepository.save({ ...productSaleslocation, }); // productTag // ["#electronics, #computer"] const result2 = []; // [{name: ..., id: ...}] for (let i = 0; i < productTags.length; i++) { const tagName = productTags[i].replace('#', ''); // check the tags that has already registered const checkTag = await this.productTagRepository.findOne({ name: tagName, }); // if the tags has been existed if (checkTag) { result2.push(checkTag); // if the tags hasn't been existed } else { const newTag = await this.productTagRepository.save({ name: tagName }); result2.push(newTag); } } const result3 = await this.productRepository.save({ ...product, productSaleslocation: result, // result 통째로 넣기 vs id만 넣기 productCategory: { id: productCategotyId }, productTags: result2, }); return result3; } async update({ productId, updateProductInput }) { const myProduct = await this.productRepository.findOne({ where: { id: productId }, }); const newProduct = { ...myProduct, id: productId, ...updateProductInput, }; return await this.productRepository.save(newProduct); } async checkSoldOut({ productId }) { const product = await this.productRepository.findOne({ where: { id: productId }, }); if (product.isSoldout) { throw new UnprocessableEntityException('Sold out'); } // if(product.isSoldout) { // throw new HttpException('이미 판매 완료 된 상품입니다.', HttpStatus.UNPROCESSABLE_ENTITY) // } } async delete({ productId }) { // 1. 실제 삭제 // const result = await this.productRepository.delete({ id: productId }); // return result.affected ? true : false // 2. 소프트 삭제(직접 구현) - isDeleted // this.productRepository.update({ id: productId }, { isDeleted: true }); // 3. 소프트 삭제(직접 구현) - deletedAt // this.productRepository.update({ id: productId }, { deletedAt: new Date() }); // 4. 소프트 삭제(TypeORM 제공) - softRemove - id로만 삭제 가능 // this.productRepository.softRemove({ id: productId }); // 4 . 소프트 삭제(TypeORM 제공) - softDelete const result = await this.productRepository.softDelete({ id: productId }); return result.affected ? true : false; } } 내용 확인 부탁드립니다.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
안녕하세요 질문있습니다!
@ObjectType이랑 @EntryType이랑 같이 사용을 할수는 없는건가요??dto와 entry가 다른부분이 없어서 같이 쓰는게 낫겠다싶어서 시도하려니 안되네요확실히 역할을 나눠야하는건가요??
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
나만의미니프로젝트 cheerio관련질문
원하는 키워드의 값을 담은 상수를 console.log(key,value) 하면 줄바꿈되면서 안에 있는 전체 값들이 나오더라구요 ( const key = $(el).attr("property").split(":")[1]; const value = $(el).attr("content"); 부분입니다)근데 이 값들을 db에 저장하려 for문을 이용해 배열에 넣어봤더니 console.log(key,value)해서 나온 값들이 아닌 마지막 값만 들어갑니다 key와 value에 어떤 형태로 값이 스크랩핑되어 들어가있는건가요..?상수에 배열형태로 들어간 것도 아니고 한줄로 값이 들어간 것도 아니고 .. console.log하면 전체가 나오기는 하나줄바꿈이 되어 나와서 갈피를 못잡겠습니다..스크래핑한 값을 어떻게 저장을하고 넘겨야할지 db로 넘겨야할지 전혀 모르겠습니다................................. 이틀동안 찾아봐도 해결이 안되어서 질문 남깁니다..
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
배포 강의를 시작하시는 분들은 인스턴스 환경변수 분리까지 보신 후에 하시면 좋을 것 같습니다.
처음에 .env파일을 깃허브에 올리시길래 띠용했지만 곧바로 수정하시는군요.지금은 연습 중이라서 올라가도 크게 문제가 없을 것 같고, 또한, 강사님께서 .env가 깃허브에 올라갔을 때 어떻게 대처하는지 알려주시기 때문에 연습 용도로도 좋아보입니다..env파일을 올리는게 찜찜하신 분들은 인스턴스 환경변수 분리까지 보신 뒤에 하시는게 좋을 것 같고, 나는 .env가 노출 된 상황을 한 번 연습해보고 싶다. 하시는 분들은 차례대로 진행하는 것도 좋을 것 같습니다!
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
userRepositorySpySave 왜 ? 0 이 안나와? 는 보십시오.
```typescriptasync create({ email, password, mobileNumber }) { const user = await this.userRepository.findOne({ where: { email } }); if (user) throw new ConflictException('이미 등록된 이메일 입니다.'); return await this.userRepository.save({ email, password, mobileNumber }); }일때 findOne({ where: { email } }) { const users = this.mydb.filter((el) => el.email === email); if (users.length) return { ...users[0] }; return null; }입니다.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
1:1 관계 등록 API 강의 creatProduct 시 에러가 발생합니다
삽입시 address 값을 입력했는데도 default 값이 설정되어있지 않다고 에러가 뜹니다.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
nest 실행 (npm run start:dev)이 너무 오래 걸려요
typescript 기초 강의에서 nest를 처음 실행했는데 실행 시 너무 오래 걸립니다..(약 20~30분 정도) windows os에서 실행 햇는데 이유가 있을까요?현재 컴퓨터 사양은 Memory 32G 에 RAM 16 Core 입니다.매번 이렇게 시간이 걸리면 현실적으로 test가 불가능해서 방법을 구하고자 합니다. +추가yarn으로 실행해봐도 비슷하네요..Windows OS에서 WSL 통해서 Ubuntu 환경에서 실행하고 있습니다.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
API-Gateway2 섹션 Apollo 서버 구동 에러
Auth와 Resource App 시작 시 아래 사진과 같은 에러가 발생합니다. 강의와 노션에 있는 코드를 그대로 작성했다고 생각하여 패키지 버전 문제로 추정됩니다.현재 제가 사용중인 패키지입니다.강의 중 사용중인 패키지 버전을 공유받고 싶습니다. 해당 오류에 대한 구글링에 실패해서 추가적으로 혹시 알고계신 레퍼런스 있으시면 알려주시면 감사드리겠습니다.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
암호화/인증 & 인가 과제 중 질문
updateUserPwd 구현 중에, 파라미터로 업데이트할 패스워드를 받도록 했습니다. 이 때, API 호출 시, 해당 파라미터의 최소 길이를 8 이상으로 하고 싶은데 따로 방법이 있을까요?
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
액세스토큰을 변수로 저장하면 생기는 문제점
안녕하세요. 강의중에 액세스토큰을 변수로 req.header에 저장하면 아래와 같이 3가지 문제점이 있다는 것을 구글링을 통해서 확인했습니다.1.보안: 액세스토큰을 req.header에 변수로서의 토큰은 공격자에 의해 가로채기에 취약합니다.2.확장성: 애플리케이션에 많은 수의 요청이 있는 경우 req.header의 변수는 크기가 커지고 성능 문제가 발생할 수 있습니다.3.지속성: req.header에 액세스 토큰을 저장하는 것은 영구적이지 않습니다. 사용자가 페이지를 새로 고치거나 브라우저를 닫으면 액세스 토큰이 손실됩니다. 이로 인해 사용자가 보호된 리소스에 액세스하기 위해 다시 로그인해야 할 수 있습니다. 질문1)3번 지속성문제의 경우, 브라우저를 새로고침하게 되면, 액세스 토큰이 사라지게 되니 오히려 보안이 좋다고 생각해야 할까요? accessToken이 수업에서는 10분으 로 만료기간을 설정했는데, restoreAccessToken API가 있기 때문에 acessToken을 req.header에 변수로 저장해도 문제가 되지 않을까요? 질문2)액세스토큰 만료시간을 10분 ~30분 으로 짧게 잡으신 이유가 1번 문제점 보안의 이유라고 생각하면 될까요? 질문3)선생님, 좋은 강의 해주셔서 진심으로 감사합니다. 저는 선생님의 백엔드와 프론트 강의를 수강후 실제 웹 서비스를 런칭하기위해서 수업을 듣고 있습니다. 현재는 백엔드 강의를 수강중입니다.실제 웹 서비스런칭시 accessToken을 req.header에 변수로서 저장하고, refreshToken은 쿠키에 저장하는 게 올바른 방법인가요?refreshToken을 수업에서 가르쳐주신 대로 secure : true, httponly: true와 같이 배포환경으로 바꿔서 배포하게 된다면 보안상 안전할까요? 질문4)구글링을 해보니, 리프레시 토큰을 Redis에 저장하고, 액세스토큰은 쿠키에 저장하는 방법도 있는 것을 확인했습니다. 액세스토큰의 만료기간을 10분으로 잡고, 리프레시토큰의 만료기간을 2주로 잡을 경우, restoreRefreshToken API 때문에 Redis DB에 자주 접속하게 되어서 DB 사용료가 많이 청구 되지는 않을까요? 서버를 stateless 상태로 웹 서비스를 런칭하기 위해서는 액세스토큰과 리프레시 토큰을 어떻게 저장해야 할까요? 가장 안전한 방법이라고 할 수 있을까요? 감사합니다.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
GqlExecutionContext가 없다고 나옵니다.
import { GqlExecutionContext } from '@nestjs/graphql';@nestjs/graphql 모둘에 내보낸 맴버 GqlExecutionContext가 없다고 에러가 뜹니다
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
JWT 토큰이 어디 저장되어 있는 건가요?
인증을 하면 JWT 액세스 토큰을 전달 받고, fetchUser의 header에 전달 받은 토큰을 넘겨 인가를 받는다는 것을 알았습니다.이 때, JWT 토큰에 대해 서버가 알고 있어야 하는데 이것이 어디에 저장되어 있는 건가요?
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
강의별 전체 코드 git으로 받아볼 수 있을까요?
안녕하세요선생님께서 강의하시는 강의별 전체 코드를 받아볼 수 있는 git 주소가 있을까요?전체 정답 코드를 보지 못하고 따라하다보니 에러가 많이 나서 선생님 것으로 확인해보고자 합니다. 그럼 답변 기다리겠습니다. 감사합니다.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
products.service.ts 의 update 함수에 대한 질문입니다.
id 값은 myproduct 안에 이미 있는데newProduct 에 id: productId 이렇게 넣어주는 이유가 있나요?45번째 줄을 주석 처리해도 차이 없이 작동하더라구요.
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
강의에서 배운 상품 CRUD를 RESTAPI 로 바꾸기
강의에서 배운 상품 CRUD를 RESTAPI로 바꿔보고 싶은데, 이게 해볼만한 시도일까요? 참조할만한 자료가 있을까요?
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
N:M 등록 / 조회 API
query{ fetchProduct(productId:"7967c808-532f-48e8-87b7-4f4536ab1903"){ id name description price isSoldout productSaleslocation{ id address addressDetail lat lng meetingTime } productCategory{ id name } productTags{ id name } } } { "errors": [ { "message": "Cannot return null for non-nullable field Query.fetchProduct.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "fetchProduct" ], "extensions": { "code": "INTERNAL_SERVER_ERROR", "exception": { "stacktrace": [ "Error: Cannot return null for non-nullable field Query.fetchProduct.", " at completeValue (C:\\Users\\enter\\OneDrive\\바탕 화면\\agarang-camp\\19-01-typeorm-crud-many-to-many\\node_modules\\graphql\\execution\\execute.js:594:13)", " at C:\\Users\\enter\\OneDrive\\바탕 화면\\agarang-camp\\19-01-typeorm-crud-many-to-many\\node_modules\\graphql\\execution\\execute.js:486:9", " at processTicksAndRejections (node:internal/process/task_queues:96:5)", " at async Promise.all (index 0)", " at execute (C:\\Users\\enter\\OneDrive\\바탕 화면\\agarang-camp\\19-01-typeorm-crud-many-to-many\\node_modules\\apollo-server-core\\src\\requestPipeline.ts:501:14)", " at processGraphQLRequest (C:\\Users\\enter\\OneDrive\\바탕 화면\\agarang-camp\\19-01-typeorm-crud-many-to-many\\node_modules\\apollo-server-core\\src\\requestPipeline.ts:407:22)", " at processHTTPRequest (C:\\Users\\enter\\OneDrive\\바탕 화면\\agarang-camp\\19-01-typeorm-crud-many-to-many\\node_modules\\apollo-server-core\\src\\runHttpQuery.ts:436:24)" ] } } } ], "data": null } 똑같이 따라헀는데, fetchproduct 부분에서 왜 이런 오류가 발생하는 것일까요? product.entity.ts 를 아래와 같이 nullable: true로 수정했는데도 플레이 그라운드에서 똑같은 에러가 나옵니다. ======================== import { Field, Int, ObjectType } from '@nestjs/graphql'; /* eslint-disable prettier/prettier */ // product.entity.ts import { ProductCategory } from 'src/apis/productCategory/entities/productCategory.entity'; import { ProductSaleslocation } from 'src/apis/productsSaleslocation/entities/productSaleslocation.entity'; import { ProductTag } from 'src/apis/productTags/entities/productTag.entity'; import { User } from 'src/apis/users/entities/user.entity'; import { Column, DeleteDateColumn, Entity, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToOne, PrimaryGeneratedColumn, } from 'typeorm'; @Entity() @ObjectType() export class Product { @PrimaryGeneratedColumn('uuid') @Field(() => String) id: string; @Column() @Field(() => String) name: string; @Column() @Field(() => String) description: string; @Column() @Field(() => Int) price: number; @Column({ default: false }) //시작시 디폴트값 @Field(() => Boolean) isSoldout: boolean; // soldedAt: Date // @Column({ default: false }) //시작시 디폴트값 // @Field(() => Boolean) // isDeleted: boolean; // @Column({ default: null }) //시작시 디폴트값 // @Field(() => Date) // DeletedAt: Date; @DeleteDateColumn() @Field({ nullable: true }) deletedAt: Date; @JoinColumn() @OneToOne(() => ProductSaleslocation) @Field(() => ProductSaleslocation) productSaleslocation: ProductSaleslocation; @ManyToOne(() => ProductCategory) @Field(() => ProductCategory) productCategory: ProductCategory; @ManyToOne(() => User) @Field(() => User, { nullable: true }) user: User; @JoinTable() @ManyToMany(() => ProductTag, (productTags) => productTags.products) @Field(() => [ProductTag]) productTags: ProductTag[]; } /*tag가 배열이다 그래프QL에서 배열은 양쪽으로 감싸는 게 배열이다. */ 위 product.enttity.ts를 수정한 이유는 DB에 deletedAt 컬럼이 null, userId 컬럼이 null로 되어 있어서 아래와 같이 추가해주었습니다. 그래도 똑같은 에러가 발생하네요. @Field({ nullable: true }) deletedAt: Date; @ManyToOne(() => User) @Field(() => User, { nullable: true }) user: User;
- 해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
1:1 관계 등록 API 질문입니다.
//18-03의 방법 2. 상품과 상품 거래위치를 같이 등록하는 경우 async create({ createProductInput }) { const { productSaleslocation, ...product } = createProductInput; console.log( '어떻게 받아오는지 createProductInput:::::::::찍어보자 ', createProductInput, ); console.log( '서비스단에서 productSaleslocation::::::::', productSaleslocation, ); // console.log('서비스단에서...product:::::::::::::::', ...product); const result = await this.productSaleslocationRepository.save({ ...productSaleslocation, // }); console.log('서비스단에서 result:::::', result); const result2 = await this.productRepository.save({ ...product, productSaleslocationId: result.id, }); console.log('서비스단에서 result2:::::', result2); return result2; } 위를 grpahql 에서 데이터를 전송해보면, 터미널창에서아래와 같이 나옵니다. 어떻게 받아오는지 createProductInput:::::::::찍어보자 [Object: null prototype] { name: '마우스', description: '참좋은마우스', price: 2000, productSaleslocation: [Object: null prototype] { address: '구로', addressDetail: '구로역', lat: 1, lng: 1, meetingTime: 2022-10-30T00:00:00.000Z } } 서비스단에서 productSaleslocation:::::::: [Object: null prototype] { address: '구로', addressDetail: '구로역', lat: 1, lng: 1, meetingTime: 2022-10-30T00:00:00.000Z } query: START TRANSACTION query: INSERT INTO `product_saleslocation`(`id`, `address`, `addressDetail`, `lat`, `lng`, `meetingTime`) VALUES (?, ?, ?, ?, ?, ?) -- PARAMETERS: ["f6bc848d-42ff-42c5-a454-39e8a9106dac","구로","구로역",1,1,"2022-10-30T00:00:00.000Z"] query: COMMIT 서비스단에서 result::::: { address: '구로', addressDetail: '구로역', lat: 1, lng: 1, meetingTime: 2022-10-30T00:00:00.000Z, id: 'f6bc848d-42ff-42c5-a454-39e8a9106dac' } query: START TRANSACTION query: INSERT INTO `product`(`id`, `name`, `description`, `price`, `isSoldout`, `deletedAt`, `productSaleslocationId`, `productCategoryId`, `userId`) VALUES (?, ?, ?, ?, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) -- PARAMETERS: ["a09e9c56-4b45-420d-98ec-c075da6014e0","마우스","참좋은마우스",2000] query: SELECT `Product`.`id` AS `Product_id`, `Product`.`isSoldout` AS `Product_isSoldout`, `Product`.`deletedAt` AS `Product_deletedAt` FROM `product` `Product` WHERE ( `Product`.`id` = ? ) AND ( `Product`.`deletedAt` IS NULL ) -- PARAMETERS: ["a09e9c56-4b45-420d-98ec-c075da6014e0"] query: COMMIT 서비스단에서 result2::::: { name: '마우스', description: '참좋은마우스', price: 2000, productSaleslocationId: 'f6bc848d-42ff-42c5-a454-39e8a9106dac', deletedAt: null, id: 'a09e9c56-4b45-420d-98ec-c075da6014e0', isSoldout: false } 어떻게 받아오는지 createProductInput:::::::::찍어보자 [Object: null prototype] { name: '마우스', description: '참좋은마우스1', price: 2000, productSaleslocation: [Object: null prototype] { address: '구로', addressDetail: '구로역', lat: 1, lng: 1, meetingTime: 2022-10-30T00:00:00.000Z } } 서비스단에서 productSaleslocation:::::::: [Object: null prototype] { address: '구로', addressDetail: '구로역', lat: 1, lng: 1, meetingTime: 2022-10-30T00:00:00.000Z } query: START TRANSACTION query: INSERT INTO `product_saleslocation`(`id`, `address`, `addressDetail`, `lat`, `lng`, `meetingTime`) VALUES (?, ?, ?, ?, ?, ?) -- PARAMETERS: ["33a4c94a-886d-4f76-9226-a363afc4b7e4","구로","구로역",1,1,"2022-10-30T00:00:00.000Z"] query: COMMIT 서비스단에서 result::::: { address: '구로', addressDetail: '구로역', lat: 1, lng: 1, meetingTime: 2022-10-30T00:00:00.000Z, id: '33a4c94a-886d-4f76-9226-a363afc4b7e4' } query: START TRANSACTION query: INSERT INTO `product`(`id`, `name`, `description`, `price`, `isSoldout`, `deletedAt`, `productSaleslocationId`, `productCategoryId`, `userId`) VALUES (?, ?, ?, ?, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) -- PARAMETERS: ["a97bb588-3074-4f1b-abaf-a9d244616dd3","마우스","참좋은마우스1",2000] query: SELECT `Product`.`id` AS `Product_id`, `Product`.`isSoldout` AS `Product_isSoldout`, `Product`.`deletedAt` AS `Product_deletedAt` FROM `product` `Product` WHERE ( `Product`.`id` = ? ) AND ( `Product`.`deletedAt` IS NULL ) -- PARAMETERS: ["a97bb588-3074-4f1b-abaf-a9d244616dd3"] query: COMMIT 서비스단에서 result2::::: { name: '마우스', description: '참좋은마우스1', price: 2000, productSaleslocationId: '33a4c94a-886d-4f76-9226-a363afc4b7e4', deletedAt: null, id: 'a97bb588-3074-4f1b-abaf-a9d244616dd3', isSoldout: false } 강의에서 설명해주신 코드는 const result2 = await this.productRepository.save({ ...product, productSaleslocation: result, }); console.log('서비스단에서 result2:::::', result2); return result2; }...product를 하면 product 테이블에 product와 관련된 데이터(name, description, price) 가 DB 테이블에 들어가는 것은 이해가 되었는데, productSaleslocation: result 라고 하면, DB에lnt, lng, meetingtime, address, adressDetail까지 전부 들어가는 게 아닌가요? 왜 DB를 확인해보면, productSaleslocation의 id 값만 productSaleslocationId 컬럼에 들어가게 되는 것인가요? 그래서 product 테이블에 productSalesloactionId 라는 컬럼이 있어서 아래와 같이 result2 코드를 작성해보았습니다. const result2 = await this.productRepository.save({ ...product, productSaleslocationId: result.id, }); 이렇게 코드를 작성하면, 상품테이블에 productSaleslocationId 컬럼이 있으니, productSaleslocationId : result.id 를 해줘서 DB에 productSaleslocationId 값을 넣을 수 있는게 왜 아닌지 이해가 가지 않습니다.왜 productSaleslocationId : result.id 라고 하면 터미널창에는 찍히지만,DB에 아무것도 들어가지 않는 것일까요?오히려 productSaleslocation: result 라고 하면, productSaleslocation의 lnt, lng, meetingtime, address, adressDetail 은 하나도 들어가지 않고, 어떠한 에러가 발생하지 않고, productSaleslocation의 id값만 외래키로 DB에 잘 들어가게 되는것일까요?