Fakultas Ilmu Komputer UI

Commit 8ba423bf authored by Doan Andreas Nathanael's avatar Doan Andreas Nathanael
Browse files

[REFACTOR] fix lint angry

parent 243b1fa3
Pipeline #77673 canceled with stages
......@@ -19,7 +19,6 @@ import { retrieveClientListApi } from 'services/profiles';
import { Client } from 'services/profiles/models';
import { submitDietRecommendationByIdApi } from 'services/dietRecommendation';
import * as ROUTES from 'constants/routes';
import { user } from 'services/auth/urls';
interface Params {
name: string;
......@@ -31,7 +30,7 @@ const ProfileDietRecommendation: FC = () => {
const navigation = useNavigation();
const [fileError, setFileError] = useState(false);
const [file, setFile] = useState<DocumentPickerResponse>();
const { name, id } = route.params as Params;
const { name: userName, id } = route.params as Params;
const { isLoading, data: clients = [] } = useApi(retrieveClientListApi);
const {
......@@ -75,7 +74,7 @@ const ProfileDietRecommendation: FC = () => {
Toast.show({
type: 'success',
text1: 'Rekomendasi berhasil dikirim',
text2: `File rencana menu serta saran gizi & gaya hidup berhasil dikirim ke client ${name}.`,
text2: `File rencana menu serta saran gizi & gaya hidup berhasil dikirim ke client ${userName}.`,
});
navigation.navigate(ROUTES.clientProfileNutritionist, {
id: client.diet_questionnaire_id,
......@@ -114,7 +113,7 @@ const ProfileDietRecommendation: FC = () => {
return (
<ScrollView style={layoutStyles}>
<HeadingLarge text={`Rekomendasi untuk ${name}`} />
<HeadingLarge text={`Rekomendasi untuk ${userName}`} />
<Section>
<BodyMedium text="Rencana porsi makan dan menu *" />
......
import React from 'react';
import { render, waitFor } from 'utils/testing';
import { render } from 'utils/testing';
import * as ROUTES from 'constants/routes';
import axios from 'axios';
import ReadOnlyDietProfile from '.';
import { mockDietQuestionnaire } from '__mocks__/dietQuestionnaire';
jest.useFakeTimers();
jest.mock('axios');
const mockAxios = axios as jest.Mocked<typeof axios>;
describe('ReadOnlyDietProfile', () => {
it('renders correctly', () => {
render(<ReadOnlyDietProfile />, ROUTES.clientProfileNutritionist, {
......
import { api, RequestMethod, ApiResponse } from '../api';
import * as apiUrls from './urls';
import {
DietRecommendationRequest,
DietRecommendationResponse,
} from './models';
import { DietRecommendationResponse } from './models';
export const retrieveDietRecommendationApi = (): ApiResponse<
DietRecommendationResponse[]
......
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