mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE): Remove location, project_flock and kandang fields
This commit is contained in:
@@ -7,21 +7,6 @@ import {
|
|||||||
} from '@/types/api/production/recording';
|
} from '@/types/api/production/recording';
|
||||||
|
|
||||||
type RecordingGrowingFormSchemaType = {
|
type RecordingGrowingFormSchemaType = {
|
||||||
location?: {
|
|
||||||
value: number;
|
|
||||||
label: string;
|
|
||||||
} | null;
|
|
||||||
location_id: number;
|
|
||||||
project_flock?: {
|
|
||||||
value: number;
|
|
||||||
label: string;
|
|
||||||
} | null;
|
|
||||||
project_flock_id: number;
|
|
||||||
kandang?: {
|
|
||||||
value: number;
|
|
||||||
label: string;
|
|
||||||
} | null;
|
|
||||||
kandang_id: number;
|
|
||||||
project_flock_kandang: {
|
project_flock_kandang: {
|
||||||
value: number;
|
value: number;
|
||||||
label: string;
|
label: string;
|
||||||
@@ -100,30 +85,6 @@ const EggObjectSchema: Yup.ObjectSchema<EggSchema> = Yup.object({
|
|||||||
|
|
||||||
export const RecordingGrowingFormSchema: Yup.ObjectSchema<RecordingGrowingFormSchemaType> =
|
export const RecordingGrowingFormSchema: Yup.ObjectSchema<RecordingGrowingFormSchemaType> =
|
||||||
Yup.object({
|
Yup.object({
|
||||||
location: Yup.object({
|
|
||||||
value: Yup.number().min(1).required(),
|
|
||||||
label: Yup.string().required(),
|
|
||||||
}).nullable(),
|
|
||||||
location_id: Yup.number()
|
|
||||||
.min(1, 'Location wajib diisi!')
|
|
||||||
.required('Location wajib diisi!')
|
|
||||||
.typeError('Location wajib diisi!'),
|
|
||||||
project_flock: Yup.object({
|
|
||||||
value: Yup.number().min(1).required(),
|
|
||||||
label: Yup.string().required(),
|
|
||||||
}).nullable(),
|
|
||||||
project_flock_id: Yup.number()
|
|
||||||
.min(1, 'Project flock wajib diisi!')
|
|
||||||
.required('Project flock wajib diisi!')
|
|
||||||
.typeError('Project flock wajib diisi!'),
|
|
||||||
kandang: Yup.object({
|
|
||||||
value: Yup.number().min(1).required(),
|
|
||||||
label: Yup.string().required(),
|
|
||||||
}).nullable(),
|
|
||||||
kandang_id: Yup.number()
|
|
||||||
.min(1, 'Kandang wajib diisi!')
|
|
||||||
.required('Kandang wajib diisi!')
|
|
||||||
.typeError('Kandang wajib diisi!'),
|
|
||||||
project_flock_kandang: Yup.object({
|
project_flock_kandang: Yup.object({
|
||||||
value: Yup.number().min(1).required(),
|
value: Yup.number().min(1).required(),
|
||||||
label: Yup.string().required(),
|
label: Yup.string().required(),
|
||||||
@@ -218,12 +179,6 @@ type RecordingFormData = Partial<Recording> & {
|
|||||||
export const getRecordingGrowingFormInitialValues = (
|
export const getRecordingGrowingFormInitialValues = (
|
||||||
initialValues?: RecordingFormData
|
initialValues?: RecordingFormData
|
||||||
): RecordingGrowingFormValues => ({
|
): RecordingGrowingFormValues => ({
|
||||||
location: null,
|
|
||||||
location_id: 0,
|
|
||||||
project_flock: null,
|
|
||||||
project_flock_id: 0,
|
|
||||||
kandang: null,
|
|
||||||
kandang_id: 0,
|
|
||||||
project_flock_kandang: initialValues?.project_flock_kandang_id
|
project_flock_kandang: initialValues?.project_flock_kandang_id
|
||||||
? {
|
? {
|
||||||
value: initialValues.project_flock_kandang_id,
|
value: initialValues.project_flock_kandang_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user