en replaced with defalutLocale cookie
This commit is contained in:
1 parent
fb89647a32
commit
80016bc39a
3 files changed
+6
-5
No files matched your search
@@ -6,7 +6,7 @@ import "react-loading-skeleton/dist/skeleton.css";
|
||||
|
||||
export default async function AboutMe() {
|
||||
const aboutMeData: AboutMeDataType = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/website/about-me/1/translation/${cookies().get("selectedLocale")?.value}`,
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/website/about-me/1/translation/${cookies().get("selectedLocale")?.value ? cookies().get("selectedLocale")?.value : cookies().get("defaultLocale")?.value}`,
|
||||
).then((res) => res.json());
|
||||
|
||||
return (
|
||||
|
||||
@@ -24,11 +24,12 @@ export default function Services({ dict }: ServicesProps) {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const fetchServices = async () => {
|
||||
setLoading(true);
|
||||
setLoading(true);
|
||||
const response = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/website/services/${getCookie("selectedLocale")}`,
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/website/services/${getCookie("selectedLocale") !== undefined ? getCookie("selectedLocale") : getCookie("defaultLocale")}`,
|
||||
).then((res) => res.json());
|
||||
|
||||
setServices(response);
|
||||
|
||||
Reference in new issue
Block a user