Fakultas Ilmu Komputer UI

Commit 03306d27 authored by Shafiya Adzhani's avatar Shafiya Adzhani
Browse files

[CHORES] fix stepper in page 3

parent dc5cb75b
Pipeline #73243 passed with stages
in 13 minutes and 29 seconds
......@@ -5,7 +5,6 @@ import {dataEmployee} from '../../data/employee'
import PropTypes from 'prop-types'
const EmployeeDropdown = ({setEmployeeData, defaultValue, dataTestId}) => {
console.log(defaultValue)
const [selectedValue, setSelectedValue] = useState(defaultValue)
const [showDropdown, setShowDropdown] = useState(false)
......
import React from 'react'
import PropTypes from 'prop-types'
const FormIUMK3 = ({data, onSubmit, handleSubmit, konstan}) => {
const FormIUMK3 = ({data, onSubmit, handleSubmit, konstan, setValue}) => {
const urutan = [
'nama',
'email',
......@@ -82,6 +82,7 @@ const FormIUMK3 = ({data, onSubmit, handleSubmit, konstan}) => {
<button
className="bg-poporange text-white heading-3 px-10 md:px-28 lg:px-24 xl:px-24 2xl:px-24 py-2 mb-10 float-right shadow rounded-lg submit"
data-testid="submit-button"
onClick={() => setValue('page', 'end')}
>
Submit
</button>
......@@ -96,6 +97,7 @@ FormIUMK3.propTypes = {
konstan: PropTypes.object,
handleSubmit: PropTypes.func,
onSubmit: PropTypes.func,
setValue: PropTypes.func,
}
export default FormIUMK3
......@@ -42,14 +42,16 @@ const FormPendirianPT = () => {
}
const onSubmit = (input) => {
setPageNumber(input.page)
if (input.page != 'end') {
setPageNumber(input.page)
}
if (pageNumber != 3) {
if (pageNumber == 1) {
setData({...data, ...input})
} else {
setData({...data, ...input, ...{karyawan: employeeData}})
}
} else {
} else if (input.page == 'end') {
axios
.post(
`${BASE_URL.API_BASE_URL}/api/v1/pt/`,
......@@ -149,6 +151,7 @@ const FormPendirianPT = () => {
konstan={konstan}
onSubmit={onSubmit}
handleSubmit={handleSubmit}
setValue={setValue}
/>
)}
</div>
......
......@@ -40,14 +40,16 @@ const FormIUMK = () => {
}
const onSubmit = (input) => {
setPageNumber(input.page)
if (input.page != 'end') {
setPageNumber(input.page)
}
if (pageNumber != 3) {
if (pageNumber == 1) {
setData({...data, ...input})
} else {
setData({...data, ...input, ...{karyawan: employeeData}})
}
} else {
} else if (input.page == 'end') {
axios
.post(
`${BASE_URL.API_BASE_URL}/api/v1/iumk/`,
......@@ -147,6 +149,7 @@ const FormIUMK = () => {
konstan={konstan}
onSubmit={onSubmit}
handleSubmit={handleSubmit}
setValue={setValue}
/>
)}
</div>
......
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