Database (1) 썸네일형 리스트형 MySQL (0) Upsert Upsert를 사용하면 간결하게 database 안에 있는 data들을 간단하게 찾거나 만들거나 업데이트할 수 있다 그럼 바로 예를 봐보자 예) async function handler(req: NextApiRequest, res: NextApiResponse) { const { email, phone } = req.body; // POST request로 받는 정보 (이메일 또는 핸드폰 번호) let user; //유저 if (email) { user = await client.user.findUnique({ where: { email, }, }); if (user) console.log(user, "user with email"); if (!user) { console.log("did not find.. 이전 1 다음