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