Fakultas Ilmu Komputer UI

Commit 95530f9f authored by Doan Andreas Nathanael's avatar Doan Andreas Nathanael
Browse files

[CHORES] integrate client list admin with navigation

parent db4889a7
...@@ -4,6 +4,7 @@ import { ...@@ -4,6 +4,7 @@ import {
unpaidClientNavigation, unpaidClientNavigation,
clientNavigation, clientNavigation,
nutritionistNavigation, nutritionistNavigation,
adminNavigation,
} from 'constants/navigation'; } from 'constants/navigation';
import { UserRole, AuthUserResponse } from 'services/auth/models'; import { UserRole, AuthUserResponse } from 'services/auth/models';
import { TransactionStatus } from 'services/payment/models'; import { TransactionStatus } from 'services/payment/models';
...@@ -33,6 +34,12 @@ export const getNavigation = ( ...@@ -33,6 +34,12 @@ export const getNavigation = (
navigation: nutritionistNavigation, navigation: nutritionistNavigation,
}; };
} }
if (user.role === UserRole.ADMIN) {
return {
initialRoute: ROUTES.clientListForAdmin,
navigation: adminNavigation,
};
}
} }
return { return {
initialRoute: ROUTES.initial, initialRoute: ROUTES.initial,
......
...@@ -29,6 +29,7 @@ import { ...@@ -29,6 +29,7 @@ import {
ClientProfile, ClientProfile,
ClientProfileForAdmin, ClientProfileForAdmin,
ProfileDietRecommendation, ProfileDietRecommendation,
ClientListAdmin,
} from 'scenes'; } from 'scenes';
import { FC } from 'react'; import { FC } from 'react';
...@@ -175,7 +176,12 @@ export const nutritionistNavigation: NavRoute[] = [ ...@@ -175,7 +176,12 @@ export const nutritionistNavigation: NavRoute[] = [
export const adminNavigation: NavRoute[] = [ export const adminNavigation: NavRoute[] = [
{ {
name: ROUTES.clientProfile, name: ROUTES.clientListForAdmin,
component: ClientListAdmin,
header: 'List Klien',
},
{
name: ROUTES.clientProfileAdmin,
component: ClientProfileForAdmin, component: ClientProfileForAdmin,
header: 'Profil Klien', header: 'Profil Klien',
}, },
......
...@@ -31,3 +31,9 @@ export const clientDietReportNutritionist = `${nutritionist}/client-diet-report` ...@@ -31,3 +31,9 @@ export const clientDietReportNutritionist = `${nutritionist}/client-diet-report`
export const clientChatNutritionist = `${nutritionist}/client-chat`; export const clientChatNutritionist = `${nutritionist}/client-chat`;
export const profileDietRecommendation = `${clientProfileNutritionist}/recommendation`; export const profileDietRecommendation = `${clientProfileNutritionist}/recommendation`;
const admin = 'admin';
export const clientListForAdmin = `${admin}/client-list`;
export const clientProfileAdmin = `${admin}/client-profile`;
export const clientDietReportAdmin = `${admin}/client-diet-report`;
export const clientChatAdmin = `${admin}/client-chat`;
...@@ -21,5 +21,7 @@ export { default as PaymentResult } from './payment/PaymentResult'; ...@@ -21,5 +21,7 @@ export { default as PaymentResult } from './payment/PaymentResult';
export { default as ClientListNutritionist } from './nutritionist/ClientListNutritionist'; export { default as ClientListNutritionist } from './nutritionist/ClientListNutritionist';
export { default as ClientListAdmin } from './admin/ClientListAdmin';
export { default as ClientProfile } from './profile/ClientProfile'; export { default as ClientProfile } from './profile/ClientProfile';
export { default as ClientProfileForAdmin } from './profile/ClientProfileForAdmin'; export { default as ClientProfileForAdmin } from './profile/ClientProfileForAdmin';
Supports Markdown
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