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

[tag]0.1-vcci

parents 4e6180c7 70a14928
Pipeline #50759 passed with stages
in 2 minutes and 42 seconds
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import { useHomePosts } from "@/app/(main)/(home)/lib/use-home-posts"; import { useHomePosts } from "@/app/(main)/(home)/lib/use-home-posts";
import ImageNext from "@/components/shared/image-next"; import ImageNext from "@/components/shared/image-next";
import memberImages from "@/constants/memberImages"; import memberImages from "@/constants/memberImages";
import links from "@/links";
import Link from "next/link"; import Link from "next/link";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Autoplay } from "swiper/modules"; import { Autoplay } from "swiper/modules";
...@@ -10,8 +11,7 @@ import { Swiper, SwiperSlide } from "swiper/react"; ...@@ -10,8 +11,7 @@ import { Swiper, SwiperSlide } from "swiper/react";
import "swiper/css"; import "swiper/css";
const MEMBER_CONNECTION_FALLBACK_IMAGE = "/home/20-2048x1365.webp"; const MEMBER_CONNECTION_FALLBACK_IMAGE = "/home/20-2048x1365.webp";
const FEATURED_MEMBER_API_URL = const FEATURED_MEMBER_API_URL = `${links.siteURL}api/featured-members`;
"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_MORE_URL = 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"; "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"; const VCCI_HCM_ORIGIN = "https://vccihcm.vn";
...@@ -75,7 +75,7 @@ function Members() { ...@@ -75,7 +75,7 @@ function Members() {
const rows = data.responseData?.rows ?? []; const rows = data.responseData?.rows ?? [];
if (isMounted) { if (isMounted) {
setFeaturedMembers(rows.slice(0, 12)); setFeaturedMembers(rows.slice(0, 9));
} }
} catch (error) { } catch (error) {
console.error(error); console.error(error);
......
...@@ -5,6 +5,7 @@ import ImageNext from "@/components/shared/image-next"; ...@@ -5,6 +5,7 @@ import ImageNext from "@/components/shared/image-next";
import partnerImages from "@/constants/partnerImages"; import partnerImages from "@/constants/partnerImages";
import { ChevronRight, Play } from "lucide-react"; import { ChevronRight, Play } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import links from "@/links";
import { fetchClientVideos } from "@/lib/api/videos"; import { fetchClientVideos } from "@/lib/api/videos";
import { Autoplay } from "swiper/modules"; import { Autoplay } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/react"; import { Swiper, SwiperSlide } from "swiper/react";
...@@ -23,8 +24,7 @@ type PartnerResponse = { ...@@ -23,8 +24,7 @@ type PartnerResponse = {
}; };
}; };
const PARTNER_API_URL = const PARTNER_API_URL = `${links.siteURL}api/partners`;
"https://vccihcm.vn/api/v1.0/organizations?filters=type%3D%3DSPONSOR&pageSize=12&sortField=sort_order&sortOrder=ASC";
const VCCI_HCM_ORIGIN = "https://vccihcm.vn"; const VCCI_HCM_ORIGIN = "https://vccihcm.vn";
const resolvePartnerImage = (avatar: string | null | undefined, index: number) => { const resolvePartnerImage = (avatar: string | null | undefined, index: number) => {
......
...@@ -9,7 +9,7 @@ const LEGACY_MEDIA_HOSTS = new Set([ ...@@ -9,7 +9,7 @@ const LEGACY_MEDIA_HOSTS = new Set([
const normalizeOrigin = (value?: string | null) => value?.trim().replace(/\/+$/, "") || ""; const normalizeOrigin = (value?: string | null) => value?.trim().replace(/\/+$/, "") || "";
const extractUploadPath = (pathname: string) => { 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) { for (const marker of markers) {
const index = pathname.indexOf(marker); const index = pathname.indexOf(marker);
...@@ -97,7 +97,11 @@ export const resolveUploadUrl = (value?: string | null) => { ...@@ -97,7 +97,11 @@ export const resolveUploadUrl = (value?: string | null) => {
} }
if (trimmed.startsWith("/")) { 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/"); const cleanPath = trimmed.replace(/^\/+/, "").replace(/^api\/uploads\//, "uploads/");
return backendOrigin ? `${backendOrigin}/${cleanPath}` : `/${cleanPath}`; return backendOrigin ? `${backendOrigin}/${cleanPath}` : `/${cleanPath}`;
} }
...@@ -106,7 +110,7 @@ export const resolveUploadUrl = (value?: string | null) => { ...@@ -106,7 +110,7 @@ export const resolveUploadUrl = (value?: string | null) => {
} }
const cleanPath = trimmed.replace(/^\/+/, "").replace(/^api\/uploads\//, "uploads/"); const cleanPath = trimmed.replace(/^\/+/, "").replace(/^api\/uploads\//, "uploads/");
if (cleanPath.startsWith("uploads/")) { if (cleanPath.startsWith("uploads/") || cleanPath.startsWith("images/")) {
return backendOrigin ? `${backendOrigin}/${cleanPath}` : `/${cleanPath}`; 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