Fakultas Ilmu Komputer UI

Commit dc5cb75b authored by Shafiya Adzhani's avatar Shafiya Adzhani
Browse files

[CHORES] fix bug on empty string post

parent e304522a
Pipeline #73073 passed with stages
in 13 minutes and 27 seconds
......@@ -5,6 +5,7 @@ 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)
......@@ -24,7 +25,9 @@ const EmployeeDropdown = ({setEmployeeData, defaultValue, dataTestId}) => {
<div className="flex flex-row items-center">
<img src={DropdownIcon} className="mr-3" />
<p className="reguler-text" data-testid="selected-value">
{selectedValue ? selectedValue : 'Pilih salah satu'}
{selectedValue && selectedValue != ''
? selectedValue
: 'Pilih salah satu'}
</p>
</div>
<img src={DropdownArrow} />
......
......@@ -32,7 +32,7 @@ const FormPendirianPT = () => {
const token = useSelector(getToken)
const [pageNumber, setPageNumber] = useState(1)
const [data, setData] = useState({})
const [employeeData, setEmployeeData] = useState(null)
const [employeeData, setEmployeeData] = useState('')
const konstan = {
paket: 'Pendirian PT',
waktu: '19 Hari',
......
......@@ -30,7 +30,7 @@ const FormIUMK = () => {
const token = useSelector(getToken)
const [pageNumber, setPageNumber] = useState(1)
const [data, setData] = useState({})
const [employeeData, setEmployeeData] = useState(null)
const [employeeData, setEmployeeData] = useState('')
const konstan = {
paket: 'Izin UMK',
waktu: '19 Hari',
......
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