add profession

This commit is contained in:
unknown
2025-04-09 13:47:32 +07:00
parent 0c5608273f
commit 02535906fd
2 changed files with 24 additions and 3 deletions

View File

@ -19,6 +19,7 @@ const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStat
const [aldeias, setAldeias] = useState([]); const [aldeias, setAldeias] = useState([]);
const [postoAdm, setPostoAdm] = useState([]); const [postoAdm, setPostoAdm] = useState([]);
const [sucos, setSucos] = useState([]); const [sucos, setSucos] = useState([]);
const [profession, setProfession] = useState([]);
const [groupData] = useState({ const [groupData] = useState({
reguler: `This fill can not be empty!`, reguler: `This fill can not be empty!`,
premium: `This field required only for Premium or Agent`, premium: `This field required only for Premium or Agent`,
@ -32,6 +33,16 @@ const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStat
async function fetchMasterData() { async function fetchMasterData() {
try { try {
let getProfession = await axios.get(`${BASE_URL_MASTER_DATA}/profession/list`, {
params: {
limit: 50,
page: 1,
with_deleted: false,
order_field: 'name',
order_direction: 'ASC',
}
});
setProfession(getProfession.data.data.list)
let getMunicipios = await axios.get(`${BASE_URL_MASTER_DATA}/municipios/list`, { let getMunicipios = await axios.get(`${BASE_URL_MASTER_DATA}/municipios/list`, {
params: { params: {
limit: 50, limit: 50,
@ -204,7 +215,17 @@ const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStat
<img width={300} height={250} srcSet={formData.file_commercial_license} src={formData.file_commercial_license} alt={"file_commercial_license"} style={{borderRadius: 10}}/> <img width={300} height={250} srcSet={formData.file_commercial_license} src={formData.file_commercial_license} alt={"file_commercial_license"} style={{borderRadius: 10}}/>
{/* AGENT & PREMIUM DATA */} {/* AGENT & PREMIUM DATA */}
<TextField disabled={viewOnly} fullWidth margin="dense" label="Profession" name="profession" value={formData.profession} onChange={handleChange} /> {/* <TextField disabled={viewOnly} fullWidth margin="dense" label="Profession" name="profession" value={formData.profession} onChange={handleChange} /> */}
<FormControl fullWidth margin="dense">
<InputLabel>Profession</InputLabel>
<Select disabled={viewOnly} name="profession" value={formData.profession} onChange={handleChange}>
{
profession ? profession.map((el: any) => (
<MenuItem key={el.id} value={el.id}>{el.name}</MenuItem>
)) : ""
}
</Select>
</FormControl>
{/* <TextField fullWidth margin="dense" label="Password" name="password" type="password" value={formData.password} onChange={handleChange} /> */} {/* <TextField fullWidth margin="dense" label="Password" name="password" type="password" value={formData.password} onChange={handleChange} /> */}
{/* <TextField fullWidth margin="dense" label="PIN" name="pin" value={formData.pin} onChange={handleChange} /> */} {/* <TextField fullWidth margin="dense" label="PIN" name="pin" value={formData.pin} onChange={handleChange} /> */}
<FormControl fullWidth margin="dense"> <FormControl fullWidth margin="dense">

View File

@ -39,8 +39,8 @@ const ManageMembers = () => {
limit: 20, limit: 20,
page: 1, page: 1,
with_deleted: false, with_deleted: false,
order_field: 'fullname', order_field: 'created_at',
order_direction: 'ASC' order_direction: 'DESC'
} }
}); });
let temp = 1; let temp = 1;