Commit 70a14928 authored by Lê Bảo Hồng Đức's avatar Lê Bảo Hồng Đức

fix

parent 4e6180c7
......@@ -3,6 +3,7 @@
import { useHomePosts } from "@/app/(main)/(home)/lib/use-home-posts";
import ImageNext from "@/components/shared/image-next";
import memberImages from "@/constants/memberImages";
import links from "@/links";
import Link from "next/link";
import { useEffect, useState } from "react";
import { Autoplay } from "swiper/modules";
......@@ -10,8 +11,7 @@ import { Swiper, SwiperSlide } from "swiper/react";
import "swiper/css";
const MEMBER_CONNECTION_FALLBACK_IMAGE = "/home/20-2048x1365.webp";
const FEATURED_MEMBER_API_URL =
"https://vccihcm.vn/api/v1.0/organizations?pageSize=12&filters=users.status_id%3D%3D36ca1cc5-7b6e-4f9f-b973-69c5207deb62&sortField=created_at&sortOrder=ASC";
const FEATURED_MEMBER_API_URL = `${links.siteURL}api/featured-members`;
const FEATURED_MEMBER_MORE_URL =
"https://vccihcm.vn/giao-thuong-b2b?filters=users.status_id+%3D%3D+36ca1cc5-7b6e-4f9f-b973-69c5207deb62&sortField=created_at&sortOrder=ASC";
const VCCI_HCM_ORIGIN = "https://vccihcm.vn";
......@@ -75,7 +75,7 @@ function Members() {
const rows = data.responseData?.rows ?? [];
if (isMounted) {
setFeaturedMembers(rows.slice(0, 12));
setFeaturedMembers(rows.slice(0, 9));
}
} catch (error) {
console.error(error);
......
......@@ -5,6 +5,7 @@ import ImageNext from "@/components/shared/image-next";
import partnerImages from "@/constants/partnerImages";
import { ChevronRight, Play } from "lucide-react";
import Link from "next/link";
import links from "@/links";
import { fetchClientVideos } from "@/lib/api/videos";
import { Autoplay } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/react";
......@@ -23,8 +24,7 @@ type PartnerResponse = {
};
};
const PARTNER_API_URL =
"https://vccihcm.vn/api/v1.0/organizations?filters=type%3D%3DSPONSOR&pageSize=12&sortField=sort_order&sortOrder=ASC";
const PARTNER_API_URL = `${links.siteURL}api/partners`;
const VCCI_HCM_ORIGIN = "https://vccihcm.vn";
const resolvePartnerImage = (avatar: string | null | undefined, index: number) => {
......
......@@ -9,7 +9,7 @@ const LEGACY_MEDIA_HOSTS = new Set([
const normalizeOrigin = (value?: string | null) => value?.trim().replace(/\/+$/, "") || "";
const extractUploadPath = (pathname: string) => {
const markers = ["/api/uploads/", "/uploads/", "/wp-content/uploads/"];
const markers = ["/api/uploads/", "/uploads/", "/images/", "/wp-content/uploads/"];
for (const marker of markers) {
const index = pathname.indexOf(marker);
......@@ -97,7 +97,11 @@ export const resolveUploadUrl = (value?: string | null) => {
}
if (trimmed.startsWith("/")) {
if (trimmed.startsWith("/uploads/") || trimmed.startsWith("/api/uploads/")) {
if (
trimmed.startsWith("/uploads/") ||
trimmed.startsWith("/api/uploads/") ||
trimmed.startsWith("/images/")
) {
const cleanPath = trimmed.replace(/^\/+/, "").replace(/^api\/uploads\//, "uploads/");
return backendOrigin ? `${backendOrigin}/${cleanPath}` : `/${cleanPath}`;
}
......@@ -106,7 +110,7 @@ export const resolveUploadUrl = (value?: string | null) => {
}
const cleanPath = trimmed.replace(/^\/+/, "").replace(/^api\/uploads\//, "uploads/");
if (cleanPath.startsWith("uploads/")) {
if (cleanPath.startsWith("uploads/") || cleanPath.startsWith("images/")) {
return backendOrigin ? `${backendOrigin}/${cleanPath}` : `/${cleanPath}`;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment