본문 바로가기

분류 전체보기

(334)
[nestjs, sql] typeorm으로 동적 where 조건문 생성하기(동적 쿼리 생성) //null을 제외한 where조건문 생성 - 동적 쿼리 생성 var whereQuery = {} if(req.lcategory) whereQuery['lcategory'] = req.lcategory if(req.mcategory) whereQuery['mcategory'] = req.mcategory if(req.scategory) whereQuery['scategory'] = req.scategory let searchTotalGuide = await getRepository(FoodGuide).find({ relations:['addAdmin','editAdmin'], where: whereQuery, order: { createdAt: 'DESC', }, }); result.guidList = ..
[0][react]useEffect 함수실행, navigate , console.log is not working useEffect내에서 console.log가 찍히지 않을때 => 1.비동기함수가 더 빠르게 작동하지 않는지 체크해볼것 ! ! 2.return 하여 렌더링되는 페이지 안에 출력되야하는 결과물이 있는지 확인할것, (있다면 해당 결과물을 조건식으로 감쌀것 ) ///해결된 실행문 const [userInPage, setUserInPage] = useState(false) useEffect(() => { //1.user === "nouser"일때 navigate()으로 코드 짰는데, 비동기 함수가 더 빠르게 작동, //따라서 if 문의 순서를 바꾸었더니 작동함. if(user !== "nouser"){ setUserInPage(true) dispatch(fetchAllUsers()); dispatch(fetch..
[java] Random cannot be resolved to a type Exception in thread "main" java.lang.Error: Unresolved compilation problems: Randomc => 'Random cannot be resolved to a type'라는 에러메시지가 뜨는 경우 패키지가 import 되지 않았거나, 변수명이 다른 경우에 이런 에러를 출력 할수 있다.
자바 - 1.기초 변수명 설정 * 자바 및 이클립스 설치 후 터미널에서 version과 javc 출력해보고 이클립스 열어서 class형 파일을 만들어서 test 진행 package practice; public class Main { public static void main(String[] args) { //1.println 칸띄우기 System.out.println("hello world"); //숫자, 스트링의 개념 //System.out.print(10+2000+"200"); //System.out.println(10+2000+"200"); //2. 변하지않는 변수값(상수) 설정 : final int x = 30; x = 40; final int y = 30; //y = 20; =>주석 해제하고 print할 경우 경고 Syst..
[0]Warning: You provided a value prop to a form field without an onChange handler. This will render a read-only field. If the field should be mutable use defaultValue. Otherwise, set either onChange or readOnly. => input tag에 readOnly를 사용하거나, value를 defaultValue로 사용하도록 권장하는 warning 인것 같았다. 1.때문에 readOnly를 사용했더니 input 내 value를 수정할수가 없고, 2.defaultValue로 변경시 계속해서 비동기로 데이터 불러올때 초기 데이터값으로만 남아있었다. 때문에 비동기로 데이터를 불러올때 데이터 불러오기전 빈배열로 초기화 로직을 추가해서 해결하였다. const Book = () => { const [bookinfo, setBookinfo] = useState([]); const getInformation = (value) =>{ setBookInfo([]) axios.get( .. ) } return ( [...] {bookinfo...
네이버검색api cors 에러 해결 : No 'Access-Control-Allow-Origin' header is present on the requested resource. 참고링크: https://msyu1207.tistory.com/entry/React%EB%A1%9C-%EC%98%81%ED%99%94-%EC%A0%95%EB%B3%B4%EB%A5%BC-%EA%B2%80%EC%83%89%ED%95%B4%EB%B3%B4%EC%9E%90-%EB%91%90%EB%B2%88%EC%A7%B8-%EB%84%A4%EC%9D%B4%EB%B2%84-API-%EC%82%AC%EC%9A%A9-CORS-%EC%84%A4%EC%A0%95-%ED%95%98%EA%B8%B0#toc-%F0%9F%93%A2CORS%EB%A5%BC%20%EC%B2%98%EB%A6%AC%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%20ONE
인코딩 디코딩 사이트 참고 참고: http://www.hipenpal.com/tool/url-encode-and-decode-in-korean.php URL 인코더/디코더 - Hi!Penpal! 문자열을 Base64 방식으로 인코딩 또는 디코딩해줍니다. www.hipenpal.com 자바스크립트 인코딩 디코딩: 참고: https://twpower.github.io/113-uri-encode-decode-in-javascript
[0]redux-toolkit unwrap 사용시 에러 =>Error: Actions must be plain objects. Use custom middleware for async actions. 비동기 불러오는 도중 unwrap 사용하는데, 다음과 같은 에러가 떴다. 생각보다 바보같은실수였다. slice내부 함수를 페이지내의 함수와 동일한 이름으로 호출하여 반복 호출되어 생긴 오류였다. 혹시라도 같은 실수를 한 분이 계시다면 네이밍을 한번더 살펴 보시길..!