Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Văn Hoàng
VCCI-News
Commits
57edd123
Commit
57edd123
authored
Aug 07, 2026
by
Lê Bảo Hồng Đức
☄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5243b3bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
page.tsx
src/app/admin/base-config/page.tsx
+22
-4
No files found.
src/app/admin/base-config/page.tsx
View file @
57edd123
...
...
@@ -53,6 +53,7 @@ import {
import
{
deleteApiV10LogoId
,
getApiV10Logo
,
getApiV10LogoId
,
postApiV10Logo
,
putApiV10LogoId
,
}
from
"@/api/endpoints/logo"
;
...
...
@@ -775,8 +776,25 @@ export default function AdminBaseConfigPage() {
const
currentLogoId
=
editingItemId
||
currentLogo
?.
id
||
null
;
try
{
const
response
=
currentLogoId
?
await
putApiV10LogoId
(
currentLogoId
,
{
let
apiLogoId
:
string
|
null
=
null
;
// If we have a currentLogoId, resolve it to actual UUID
if
(
currentLogoId
)
{
try
{
const
logoResponse
=
await
getApiV10LogoId
(
currentLogoId
);
const
existingLogo
=
getEnvelopeData
<
Logo
>
(
logoResponse
);
// Only use if it's a valid UUID (32+ chars with hyphens)
if
(
existingLogo
?.
id
&&
existingLogo
.
id
.
match
(
/^
[
0-9a-f
]
{8}-
[
0-9a-f
]
{4}-
[
0-9a-f
]
{4}-
[
0-9a-f
]
{4}-
[
0-9a-f
]
{12}$/i
))
{
apiLogoId
=
existingLogo
.
id
;
}
}
catch
{
// currentLogoId is not a valid UUID or fetch failed, treat as create new
apiLogoId
=
null
;
}
}
const
response
=
apiLogoId
?
await
putApiV10LogoId
(
apiLogoId
,
{
logo_name
:
trimmedName
,
logo_url
:
selectedMedia
?.
url
??
null
,
file_id
:
itemForm
.
imageId
,
...
...
@@ -787,11 +805,11 @@ export default function AdminBaseConfigPage() {
file_id
:
itemForm
.
imageId
,
});
const
savedLogo
=
getEnvelopeData
<
NonNullable
<
SiteInformationData
[
"logo"
]
>
>
(
response
);
getEnvelopeData
<
Logo
>
(
response
);
const
nextConfig
=
cloneBaseConfigData
(
config
);
nextConfig
.
logo
=
{
id
:
savedLogo
?.
id
??
current
LogoId
??
createBaseConfigItemId
(
"logo"
),
id
:
savedLogo
?.
id
??
api
LogoId
??
createBaseConfigItemId
(
"logo"
),
name
:
savedLogo
?.
logo_name
??
trimmedName
,
imageId
:
savedLogo
?.
file_id
??
itemForm
.
imageId
,
isActive
:
true
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment