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
7fb31e35
Commit
7fb31e35
authored
Nov 12, 2025
by
Phạm Quang Bảo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix/category default
parent
4be77472
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
page.tsx
src/app/(main)/[...slug]/page.tsx
+9
-2
No files found.
src/app/(main)/[...slug]/page.tsx
View file @
7fb31e35
...
@@ -45,6 +45,9 @@ export default function DynamicPage() {
...
@@ -45,6 +45,9 @@ export default function DynamicPage() {
const
{
data
:
categoriesPage
}
=
useGetNewsPageConfigGetHierarchical
<
GetNewsPageConfigResponseType
>
({
const
{
data
:
categoriesPage
}
=
useGetNewsPageConfigGetHierarchical
<
GetNewsPageConfigResponseType
>
({
code
:
`
${
slugArray
[
0
]}
`
,
code
:
`
${
slugArray
[
0
]}
`
,
});
});
const
{
data
:
categoriesPageDefault
}
=
useGetNewsPageConfigGetHierarchical
<
GetNewsPageConfigResponseType
>
({
code
:
`thong-tin-truyen-thong`
,
});
const
{
data
:
events
,
isLoading
:
isLoadingEvents
}
=
useGetEvents
<
EventApiResponse
>
({
const
{
data
:
events
,
isLoading
:
isLoadingEvents
}
=
useGetEvents
<
EventApiResponse
>
({
pageSize
:
String
(
pageSize
),
pageSize
:
String
(
pageSize
),
...
@@ -62,7 +65,7 @@ export default function DynamicPage() {
...
@@ -62,7 +65,7 @@ export default function DynamicPage() {
});
});
const
{
data
:
newsDetail
,
isLoading
:
isLoadingNewsDetail
}
=
useGetNews
<
GetNewsResponseType
>
({
const
{
data
:
newsDetail
,
isLoading
:
isLoadingNewsDetail
}
=
useGetNews
<
GetNewsResponseType
>
({
filters
:
`
page_config.static_link==/
${
url
}
`
+
`,
external_link@=
${
lastPart
}
`
,
filters
:
`external_link@=
${
lastPart
}
`
,
});
});
// event page
// event page
...
@@ -245,7 +248,11 @@ export default function DynamicPage() {
...
@@ -245,7 +248,11 @@ export default function DynamicPage() {
return
(
return
(
<
div
className=
'container w-full flex justify-center items-center pb-10'
>
<
div
className=
'container w-full flex justify-center items-center pb-10'
>
<
div
className=
'flex flex-col gap-5 w-full'
>
<
div
className=
'flex flex-col gap-5 w-full'
>
<
ListCategory
categories=
{
categoriesPage
?.
responseData
?.
children
}
/>
{
categoriesPage
?.
responseData
?.
children
?
(
<
ListCategory
categories=
{
categoriesPage
?.
responseData
?.
children
}
/>
)
:
(
<
ListCategory
categories=
{
categoriesPageDefault
?.
responseData
?.
children
}
/>
)
}
<
div
className=
"grid grid-cols-1 lg:grid-cols-3 gap-5"
>
<
div
className=
"grid grid-cols-1 lg:grid-cols-3 gap-5"
>
<
main
className=
"lg:col-span-2 bg-white border rounded-md p-8"
>
<
main
className=
"lg:col-span-2 bg-white border rounded-md p-8"
>
{
isLoadingNewsDetail
?
(
{
isLoadingNewsDetail
?
(
...
...
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