-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mạnh Tùng Nguyễn
authored and
Mạnh Tùng Nguyễn
committed
Jul 4, 2024
1 parent
908d320
commit 2375d25
Showing
10 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {useEffect, useState} from "react"; | ||
import callApi from "../../apis/GatewayApi.js"; | ||
import InputAutocomplete from "./core/InputAutocomplete.jsx"; | ||
import PropTypes from "prop-types"; | ||
|
||
const InputSelectHolder = (props) => { | ||
const [holders, setHolders] = useState([]) | ||
const [isLoading, setIsLoading] = useState(true) | ||
|
||
useEffect(() => { | ||
getHolders() | ||
}, []); | ||
|
||
const getHolders = () => { | ||
setHolders([]) | ||
|
||
callApi('pkg_bud_holder.get_all', {}, (data) => { | ||
setHolders(data.map((e) => { | ||
return { | ||
value: e.PK_BUD_HOLDER, | ||
label: e.C_HOLDER_NAME | ||
} | ||
})) | ||
|
||
setIsLoading(false) | ||
}) | ||
} | ||
|
||
return <InputAutocomplete | ||
data={holders} | ||
isLoading={isLoading} | ||
{...props} | ||
/> | ||
} | ||
|
||
export default InputSelectHolder; |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.