From fb67f4b680539a727c00e57673b9063f330fc582 Mon Sep 17 00:00:00 2001 From: DeathKaioken Date: Mon, 17 Nov 2025 17:23:16 +0100 Subject: [PATCH] bug: merge conflict --- src/app/components/nav/Header.tsx | 23 ++++++++++++++++------- src/app/utils/api.ts | 7 +++---- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/app/components/nav/Header.tsx b/src/app/components/nav/Header.tsx index f9d7faa..7c1f872 100644 --- a/src/app/components/nav/Header.tsx +++ b/src/app/components/nav/Header.tsx @@ -1,6 +1,6 @@ 'use client' -import { useState, useEffect, useCallback } from 'react' +import { useState, useEffect, useCallback, useRef } from 'react' import { useRouter } from 'next/navigation'; import Image from 'next/image'; import { @@ -56,6 +56,7 @@ export default function Header() { const [hasReferralPerm, setHasReferralPerm] = useState(false) // NEW: admin management dropdown state const [adminMgmtOpen, setAdminMgmtOpen] = useState(false) + const managementRef = useRef(null) const handleLogout = async () => { try { @@ -402,25 +403,26 @@ export default function Header() { Admin Navigation - {/* MOVED: User Verify now before Management */} - {/* Management dropdown (unchanged) */} + {/* Updated Management dropdown */}
setAdminMgmtOpen(false)} > {adminMgmtOpen && ( -
+
diff --git a/src/app/utils/api.ts b/src/app/utils/api.ts index 6cff81e..68ea96d 100644 --- a/src/app/utils/api.ts +++ b/src/app/utils/api.ts @@ -46,16 +46,13 @@ export const API_ENDPOINTS = { ADMIN_UPDATE_USER_VERIFICATION: '/api/admin/update-verification/:id', ADMIN_UPDATE_USER_PROFILE: '/api/admin/update-user-profile/:id', ADMIN_UPDATE_USER_STATUS: '/api/admin/update-user-status/:id', -<<<<<<< HEAD // Coffee products (admin) ADMIN_COFFEE_LIST: '/api/admin/coffee', ADMIN_COFFEE_CREATE: '/api/admin/coffee', ADMIN_COFFEE_UPDATE: '/api/admin/coffee/:id', ADMIN_COFFEE_SET_STATE: '/api/admin/coffee/:id/state', ADMIN_COFFEE_DELETE: '/api/admin/coffee/:id', -======= - ADMIN_CONTRACT_PREVIEW: '/api/admin/contracts/:id/preview', ->>>>>>> 757b530e14a4c81bd8a54ae569dab647f906421a + ADMIN_CONTRACT_PREVIEW: '/api/admin/contract-preview/:id', } // API Helper Functions @@ -441,6 +438,8 @@ export class AdminAPI { const resp = await ApiClient.delete(endpoint, token) if (!resp.ok) throw new Error('Failed to delete product') return true + } + static async getContractPreviewHtml(token: string, userId: string, userType?: 'personal' | 'company') { let endpoint = API_ENDPOINTS.ADMIN_CONTRACT_PREVIEW.replace(':id', userId) if (userType) {