본문 바로가기

분류 전체보기

(39)
08.29 TIL 코멘트 및 카드에서 정보를 불러올 대 해당 user나 card의 모든 데이터를 불러오는 문제. const commentsWithUser = findComments.map((comment) => ({ id: comment.id, reply_id: comment.reply_id, comment: comment.comment, created_at: comment.created_at, updated_at: comment.updated_at, user: { id: comment.user.id, name: comment.user.name, }, card: { // 카드 관련 데이터도 필요에 따라 추출 id: comment.card.id, // 다른 카드 관련 데이터도 필요에 따라 추가할 수 있습니다. }, }));..
08.28 TIL 보드 페이지에서 카드를 누르면 카드 디테일 모달 창 뿐만이 아닌 카드 수정 모달이 같이 뜨는 오류가 발생 // 카드 세부 정보 모달을 열기 위한 함수 function openCardDetailModal(columnId, cardId) { // 카드 세부 정보를 서버에서 가져오는 API 호출 DetailCardGet(columnId, cardId); cardAllUpdate(columnId, cardId); } 카드 업데이트 모달에 칼럼, 카드 아이디를 넘겨주기 위한 코드를 카드를 클릭했을때 같이 실행하게 만들어서 생겼던 문제로 생각 // 카드 세부 정보 모달을 열기 위한 함수 function openCardDetailModal(columnId, cardId) { // 카드 세부 정보를 서버에서 가져오는 ..
08.24 TIL 현재 프론트 작업중 그런데 카드 수정 프론트 작업을 하려니 카드 디테일 모달 작업부터 해야했다. 그런데 아무리 코드를 만져봐요 카드의 정보가 담긴 모달 페이지가 아닌 예시로 만들어 놓은 모달 페이지가 나온다. 카드를 클릭해도 애초에 서버에 아무런 요청도 보내지 않는다. 뭐가 문제인지 모르겠다. 오늘내일까지 마감해야되는데 그냥 미칠 지경이다.
08.23 TIL 오늘은 굉장히 많은 오류가 있었따. 간단 한 것론 async DeleteComment(cardId: number, id: number, user_Id: number) { // 코멘트를 삭제하기 전에 해당 코멘트가 유저의 것인지 확인할 수 있는 로직을 추가할 수 있습니다. const existingComment = await this.commentRepository .createQueryBuilder('comment') .where('comment.id = :id', { id }) .andWhere('comment.user_Id = :user_Id', { user_Id }) // 'user_Id' 필드 대신 'userId'를 사용합니다. .getOne(); if (!existingComment) { con..
08.22 TIL 카드 생성 api 구현 중 더보기 Cannot add or update a child row: a foreign key constraint fails (`database_workFlow_project`.`cards`, CONSTRAINT `FK_0813e876c2b327e7c4ae7cc4793` FOREIGN KEY (`board_column_id`) REFERENCES `board_columns` (`id`) ON DELETE CASCADE) 이런 오류 발생 //카드 생성 async CreateCard( board_column_id: number, name: string, content: string, file_url: string, sequence: number, color: string, membe..
08.21 TIL 코멘트쪽 api 작성후 더보기 Nest can't resolve dependencies of the BoardColumnsService (Board_ColumnRepository, ?). Please make sure that the argument BoardsService at index [1] is available in the CommentsModule context. Potential solutions: - Is CommentsModule a valid NestJS module? - If BoardsService is a provider, is it part of the current CommentsModule? - If BoardsService is exported from a separate ..
08.18 TIL import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { Card } from 'src/_common/entities/card.entity'; import { Column } from 'src/_common/entities/board-column.entity'; @Injectable() export class CardsService { constructor( @InjectRepository(Card) private cardRepository: Repository, @Inje..
TIL 08.17 import { Body, Controller } from '@nestjs/common'; import { CreateCatDto } from './CreateCatDto'; @Controller('cats') export class CatsController { @Get() findAll(): string { return 'this action return all cats'; } @Get(':id') findOne(@Param('id') id: string): string { return `This action returns a #${id} cat`; } @Post() create(@Body() createCatDto: CreateCatDto) { return 'This action adds a new..