change format all file
This commit is contained in:
+10
-6
@@ -5,12 +5,16 @@ import citiesData from "@/data/city.json";
|
||||
import statesData from "@/data/state.json";
|
||||
|
||||
export function getStateInfo() {
|
||||
const headersList = headers();
|
||||
const host = headersList.get("host") || "";
|
||||
const subdomain = host.split(".")[0];
|
||||
const headersList = headers();
|
||||
const host = headersList.get("host") || "";
|
||||
const subdomain = host.split(".")[0];
|
||||
|
||||
const matchedCity = citiesData.find((city) => city.domain.includes(subdomain));
|
||||
const matchedState = matchedCity && statesData.find(state => state.id === matchedCity.province_id)
|
||||
const matchedCity = citiesData.find((city) =>
|
||||
city.domain.includes(subdomain),
|
||||
);
|
||||
const matchedState =
|
||||
matchedCity &&
|
||||
statesData.find((state) => state.id === matchedCity.province_id);
|
||||
|
||||
return { matchedCity, matchedState };
|
||||
return { matchedCity, matchedState };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user