Skip to content

Commit 20db4cc

Browse files
CopilotTechQuery
andcommitted
Complete China Public Interest Map implementation with working navigation
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
1 parent ca30930 commit 20db4cc

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

components/Navigator/MainNavigator.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ const topNavBarMenu = ({ t }: typeof i18n): MenuItem[] => [
5252
{ href: '/policy', title: t('policy') },
5353
],
5454
},
55+
{
56+
title: t('china_public_interest_map'),
57+
subs: [
58+
{ href: '/organization', title: t('china_public_interest_map') },
59+
{ href: '/organization/landscape', title: t('china_public_interest_landscape') },
60+
],
61+
},
5562
];
5663

5764
export interface MainNavigatorProps {

models/Organization.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ const strapiClient = new HTTPClient({
3636

3737
export class OrganizationModel extends StrapiListModel<Organization> {
3838
baseURI = '/organizations';
39-
40-
constructor() {
41-
super();
42-
this.client = strapiClient;
43-
}
39+
client = strapiClient;
4440

4541
@observable
4642
accessor tagMap: Record<string, Organization[]> = {};
@@ -85,7 +81,9 @@ export class OrganizationStatisticModel {
8581
try {
8682
// This would need to be adapted based on the actual Strapi API structure
8783
const response = await this.client.get(`${this.collection}`);
88-
return response.body?.data || [];
84+
// Handle potential different response structures
85+
const data = response.body?.data || response.body || [];
86+
return Array.isArray(data) ? data : [];
8987
} catch (error) {
9088
console.error(`Failed to fetch statistics for ${this.collection}:`, error);
9189
return [];

0 commit comments

Comments
 (0)