Posts
Q&A
๋ฐฐํฌ๋๋๋๋ฐ ํ์๊ฐ์ ๋ถํฐ ์ค๋ฅ๊ฐ ๋ง๋น๋๋ค
ํน์ ํด๊ฒฐํ์ จ๋์?
- Likes
- 0
- Comments
- 3
- Viewcount
- 585
Q&A
ํฌ์คํธ๋ชฉ๋ก์์ ์ญ์ ๋ฒํผ์ ๊ตฌํํ๋ค๊ณ ํด๋ดค๋๋ฐ ์๋ํ์ง๊ฐ์์์
์ ๋ ๊ฐ์๋ฅผ ๋ง์น๊ณ ์ญ์ , ์์ , ๊ฒ์ ๊ธฐ๋ฅ ๊ฐ์๊ฑฐ ์ง์ ๊ตฌํํ๋๋ฐ ํน์ ํ์ํ์๋ค๋ฉด ์ฐธ๊ณ ํ์ธ์ฉ! ๊ฐ์ฌ๋ ํน์ ํ๋ฆฐ์ฝ๋ ์๋ค๋ฉด ์๋ ค์ฃผ์ธ์~ ์ปค๋ฎค๋ํฐ,๊ฒ์๊ธ,๋๊ธ ์ญ์ ๊ธฐ๋ฅconst deleteSub = async (req: Request, res: Response) => { const { name } = req.params; try { const community = await Sub.findOneByOrFail({ name }); const sub = await Sub.createQueryBuilder() .delete() .from(Sub) .where({ name: community.name }) .execute(); if (community.imageUrn) { const deleteImage = path.resolve( process.cwd(), 'public', 'images', community.imageUrn ); unlinkSync(deleteImage); } if (community.bannerUrn) { const deleteBanner = path.resolve( process.cwd(), 'public', 'images', community.bannerUrn ); unlinkSync(deleteBanner); } if (!sub) return; return res.json(sub); } catch (error) { console.log(error); return res.status(404).json({ error: '๋ฌธ์ ๊ฐ ๋ฐ์ํ์์ต๋๋ค.' }); } };
- Likes
- 0
- Comments
- 1
- Viewcount
- 468




