분류 전체보기 (334) 썸네일형 리스트형 [0]NESTJS typeorm date 타입 날짜 between으로 데이터 찾기 출처: https://www.kindacode.com/snippet/typeorm-selecting-rows-between-2-dates/ import { Between } from "typeorm"; /* Other code */ const userRepository = dataSource.getRepository(User); const users = await userRepository.find({ where: { createdAt: Between( new Date(2019, 5, 3), new Date(2022, 5, 3) ), } }) console.log(users); [0]nestjs typeorm OR, AND 참고: https://orkhan.gitbook.io/typeorm/docs/find-options //AND 연산 userRepository.find({ where: { firstName: "Timber", lastName: "Saw" } }); //OR 연산 userRepository.find({ where: [ { firstName: "Timber", lastName: "Saw" }, { firstName: "Stan", lastName: "Lee" }, ], }); [0]nestjs 페이징 ( take, skip 사용) //1.초기: javascript slice 사용하여 페이징 => 매번 totalQList를 불러와야함 if (req.category === '작성자') { let totalQList = !( req.userId === '' || req.userId === null || req.userId === undefined ) ? await this.customenrCenterQ.find({ userId: req.userId, }) : await this.customenrCenterQ.find(); result.QList = totalQList; // let totalPageCount = Math.ceil(totalQList.length / slicePage); // result.totalPage = totalP.. nestjs 공부(개념) entity와 dto 의 차이 entity : db 테이블 그 자체 dto : entity를 가공(필요한 데이터만 자르거나, 숫자등을 가공)하거나 공통된 output을 묶어 놓은 것 service.ts =>AdminDto : 입력받는 파라미터 , AdminRes:출력하는 데이터 =>Promise 붙는이유: 데이터를 가져오므로 ( 만약 코드내에 전달할 dto가 따로 작성되어있다면 async promise 필요없음) async Function(adminData:AdminDto): Promise { [...] } jdk설치 후 ~/.bash_profile 에 환경변수 설정 **에러뜨는 이유: 본인인증관련해서 java 설치해야할 경우가 있어서 npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm ERR! code 1 npm ERR! path /Users/****/Desktop/hps303_back/node_modules/java npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! CXX(target) Release/obj.target/nodejavabridge_bindings/src/java.o npm ER.. 특정 페이지에서 새로고침 window.location.reload(); formData 데이터 수정시 id 값 number로 변환되지 않아 수정이 아닌 새 게시물로 생성되는 오류 //src/features/admin/contentSlice.js export const saveFullGuide = createAsyncThunk( "contents/safeFullGuide", async (params) => { console.log(params, ">params"); const config = { headers: { "content-type": "multipart/form-data" } }; const formdata = new FormData(); formdata.append("id", params.id); [...] params.files.forEach((file) => formdata.append("files", file)); const res = await api.post(".. the react-scripts package provided by create react app requires a dependency: "webpack": "4.42.0" ** 문제 이슈 : 해당 폴더의 webpack의 버전이 안 맞는 부분 ** 해결 방안 : vsc terminal 이 아닌 맥북 자체 terminal 에서 npm ls webpack 으로 webpack이 global하게 깔려있는 위치를 파악한 후 sudo uninstall -g webpack / sudo npm rm -rf webpack 으로 webpack 을 삭제 해준후 실행시켰더니 작동이 되었음. admins@adminsui-MacBookPro-2 ~ % npm ls webpack /Users/admins ├─┬ @nestjs/cli@8.2.8 extraneous │ └── webpack@5.73.0 deduped ├─┬ fork-ts-checker-webpack-plugin@7.2.11 extrane.. 이전 1 ··· 10 11 12 13 14 15 16 ··· 42 다음