Open trr456-hub opened 1 year ago
const handleTestPayment = async () => { const docRef = doc(dbService, storeNumber, userId); try { const docSnap = await getDoc(docRef); const prevItems = docSnap.exists() ? docSnap.data().order : []; const newItem = [...prevItems, cartItem]; await setDoc(docRef, { order: newItem, }); } catch (error) { console.log("에러 : ", error); } };
이 코드에서 Uncaught (in promise) TypeError: n.indexOf is not a function 결제창으로 넘어갈때 이런코드가 생성됐다
DataBase 에 들어가는 컬렉션 이름은 number 타입은 들어가지 못해 생성되는 에러였다. storeNumber 에 toString 으로 string 화 해주면 에러는 해결된다
이 코드에서 Uncaught (in promise) TypeError: n.indexOf is not a function 결제창으로 넘어갈때 이런코드가 생성됐다