mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 14:55:44 +00:00
chore: format code using prettier
This commit is contained in:
@@ -3,10 +3,7 @@ import * as Yup from 'yup';
|
||||
export const FlockFormSchema = Yup.object({
|
||||
name: Yup.string()
|
||||
.required('Nama wajib diisi!')
|
||||
.matches(
|
||||
/^[\p{L}\p{N}\s]+$/u,
|
||||
'Nama tidak boleh mengandung simbol'
|
||||
),
|
||||
.matches(/^[\p{L}\p{N}\s]+$/u, 'Nama tidak boleh mengandung simbol'),
|
||||
});
|
||||
|
||||
export const UpdateFlockFormSchema = FlockFormSchema;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
'use client'
|
||||
'use client';
|
||||
|
||||
import { useModal } from '@/components/Modal';
|
||||
import { FlockApi } from '@/services/api/master-data';
|
||||
import { Flock } from '@/types/api/master-data/flock';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { FlockFormSchema, FlockFormValues, UpdateFlockFormSchema } from '@/components/pages/master-data/flock/form/FlockForm.schema';
|
||||
import {
|
||||
FlockFormSchema,
|
||||
FlockFormValues,
|
||||
UpdateFlockFormSchema,
|
||||
} from '@/components/pages/master-data/flock/form/FlockForm.schema';
|
||||
import { useFormik } from 'formik';
|
||||
import Button from '@/components/Button';
|
||||
import { Icon } from '@iconify/react';
|
||||
@@ -48,7 +52,8 @@ const FlockForm = ({ formType = 'add', initialValues }: FlockCustomProps) => {
|
||||
const formik = useFormik<FlockFormValues>({
|
||||
initialValues: formikInitialValue,
|
||||
enableReinitialize: true,
|
||||
validationSchema: formType === 'edit' ? UpdateFlockFormSchema : FlockFormSchema,
|
||||
validationSchema:
|
||||
formType === 'edit' ? UpdateFlockFormSchema : FlockFormSchema,
|
||||
onSubmit: async (values) => {
|
||||
// reset error message
|
||||
setFlockFormErrorMessage('');
|
||||
|
||||
Reference in New Issue
Block a user