forked from UKSOURCE/cms.hailearning.edu.vn
Merge pull request 'update API Country' (#11) from fea/hoang-04022026-Visa/VisaDetail into main
Reviewed-on: UKSOURCE/cms.hailearning.edu.vn#11
This commit is contained in:
@@ -504,9 +504,8 @@ exports.apiCountries = async (req, res) => {
|
|||||||
|
|
||||||
// 1. Lọc bỏ 'viewDetail' khỏi từng quốc gia trong danh sách
|
// 1. Lọc bỏ 'viewDetail' khỏi từng quốc gia trong danh sách
|
||||||
const filteredCountries = visaData.hero.summaryList.map((item) => {
|
const filteredCountries = visaData.hero.summaryList.map((item) => {
|
||||||
// Dùng destructuring để tách viewDetail ra và gom phần còn lại vào countryInfo
|
// Trả về bản sao của item để giữ nguyên cấu trúc gốc bao gồm cả detailedView
|
||||||
const { detailedView, ...countryInfo } = item;
|
return { ...item };
|
||||||
return countryInfo;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 2. Gắn baseUrl vào ảnh cho danh sách đã lọc
|
// 2. Gắn baseUrl vào ảnh cho danh sách đã lọc
|
||||||
|
|||||||
@@ -480,8 +480,6 @@ router.get("/visa", ensureAuthenticated, visaController.index);
|
|||||||
// Get country data for editing
|
// Get country data for editing
|
||||||
router.get("/visa/edit/:id", ensureAuthenticated, visaController.getCountry);
|
router.get("/visa/edit/:id", ensureAuthenticated, visaController.getCountry);
|
||||||
|
|
||||||
router.get("/visa/country", visaController.apiCountries);
|
|
||||||
|
|
||||||
// Update hero title
|
// Update hero title
|
||||||
router.post("/visa/update", ensureAuthenticated, visaController.update);
|
router.post("/visa/update", ensureAuthenticated, visaController.update);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user