본문 바로가기

NEW(스크립트용)

(15)
A function whose declared type is neither 'void' nor 'any' must return a value.137 async addPosting(files, req: PostingDto): Promise<CoreOutput> async addPosting(files, req: PostingDto): Promise { const result = new CoreOutput(); [...] } result를 return 해주지 않아서 생기는 오류였다..
entity cascade ManyToOne, OneToMany —> 이 릴레이션은 쌍으로 쓰게 되어 있는데, ManyToOne 데코레이션을 쓰는 쪽에 ForeignKey가 생성된다. 보통 OneToMany 데코를 쓰는 쪽이 부모(주체)가 되고 ManyToOne 데코를 쓰는 쪽이 자식(객체)가 된다. ex) Author(글쓴이): OneToMany , Posting(글): ManyToOne 한 글쓴이는 자신의 아이디로 많은 글을 올릴수 있지만(Posting), 한 포스팅 아이디는 (글을 나눠서 공동으로 쓰지 않는한) 한 글쓴이로 밖에 매핑이 안된다. JoinColumn은 객체쪽에서 지정을 해준다. CASCADE 옵션을 줄때는, 객체 쪽(Posting)에 { onDelete: “CASCADE”}, 주체 쪽(Author)에 {casc..
any를 활용하여 database 내부 value 값이 array 일 때 filtering async searchKeyword(req: KeywordSearchReq): Promise { const result = new PostingKeywordResDto(); result.ok = true; try { if (req.keyword !== undefined) { this.postings.createQueryBuilder('Posting').where(''); //any let searchResul = await this.postings .createQueryBuilder('Postings') .where(`'` + req.keyword + `' = ANY(keyword)`) .getMany(); result.postingList = searchResul; console.log(searchRe..
특정 페이지에서 새로고침 window.location.reload();
position:sticky position: sticky flexbox 안에 있거나, overflow:hidden 안에 있을때 작동하지 않음.
video full screen 반응형 사파리와 크롬의 브라운저 엔진 자체의 정책에서 음소거 요소를 추가해 줘야 한다.(자동재생시 제한이 있음) import React from "react"; import Footer from "../Components/Footer"; import Menubar from "../Components/Menubar"; import Totop from "../Components/Totop"; import "./Main.css"; import mainvideo_sample from "../../assets/images/etc/mainvideo_sample.png"; import project1 from "../../assets/videos/project1.mp4"; export default function Main..
flex-direction column 설정시 양쪽 위치(즉, 상하)를 변경하고 싶을때 flex-direction 의 column, column-reverse를 사용한다. @media (max-width: 768px) { .flexgap { flex-direction: column; } /* .flexgap:nth-child(1) { flex-direction: column; } .flexgap:nth-child(2) { flex-direction: column-reverse; } */ }
input checkbox react에서 ui변경(html과 다름) input[type="checkbox"] { appearance: none; width: 1.5rem; height: 1.5rem; border: 1.5px solid gainsboro; border-radius: 50%; } input[type="checkbox"]:checked { border-color: transparent; background-repeat: no-repeat; background-color: limegreen; }