Fakultas Ilmu Komputer UI

Commit c1468087 authored by wulanmantiri's avatar wulanmantiri
Browse files

[GREEN] Add API for diet progress, adjust weekly report form fields

parent 316a3d1c
Pipeline #80667 passed with stages
in 11 minutes and 1 second
......@@ -10,21 +10,21 @@ export const dietReportTextFields: { [_: string]: TextFieldSchema[] } = {
dietReportPage1: [
{
label: 'Berat Badan (kg)',
placeholder: 'Masukkan yang terakhir diukur',
placeholder: 'Masukkan berat badan yang terakhir diukur',
name: 'weight',
required: true,
keyboardType: 'numeric',
},
{
label: 'Tinggi Badan (cm)',
placeholder: 'Masukkan yang terakhir diukur',
placeholder: 'Masukkan tinggi badan yang terakhir diukur',
name: 'height',
required: true,
keyboardType: 'numeric',
},
{
label: 'Lingkar Pinggang (cm)',
placeholder: 'Masukkan yang terakhir diukur',
placeholder: 'Masukkan lingkar pinggang yang terakhir diukur',
name: 'waist_size',
required: true,
keyboardType: 'numeric',
......@@ -45,6 +45,7 @@ export const dietReportTextFields: { [_: string]: TextFieldSchema[] } = {
{
label:
'Dalam 1 minggu terakhir, apa saja yang sudah bisa Anda pelajari dari program ini?',
placeholder: 'Masukkan pelajaran minggu ini',
name: 'lesson_learned',
required: true,
multiline: true,
......@@ -54,6 +55,7 @@ export const dietReportTextFields: { [_: string]: TextFieldSchema[] } = {
label: `Silahkan sampaikan disini, jika Anda mempunyai:
(1) kendala, keluhan atau kesulitan dalam mengikuti program, atau
(2) masukan, saran, dan komplain terkait layanan sejauh ini.`,
placeholder: 'Masukkan keluh kesah atau saran bagi Dietela',
name: 'problem_faced_and_feedbacks',
multiline: true,
},
......
import { api, RequestMethod, ApiResponse } from '../api';
import * as apiUrls from './urls';
import { UserReportResponse } from './models';
import { UserReportResponse, UserReportRequest } from './models';
export const retrieveUserReportById = (
id: number,
clientId: number,
): ApiResponse<UserReportResponse[]> => {
return api(RequestMethod.GET, apiUrls.userReportById(id));
return api(RequestMethod.GET, apiUrls.userReportByClientId(clientId));
};
export const createUserReportApi = (
payload: UserReportRequest,
): ApiResponse<UserReportResponse> => {
return api(RequestMethod.POST, apiUrls.userReport, payload);
};
export const progress = 'progress/';
export const userReportById = (id: number) => `${progress}${id}`;
export const userReport = `${progress}user_report/`;
export const userReportByClientId = (id: number) =>
`${userReport}?client_id=${id}`;
Markdown is supported
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