fix:user edit
This commit is contained in:
parent
6202af2149
commit
19f71eb972
|
|
@ -202,6 +202,8 @@ export default function FormMasterUserEdit() {
|
|||
className="w-full lg:w-1/2 lg:ml-4"
|
||||
>
|
||||
<Card className="rounded-md p-5 flex flex-col gap-3">
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">Nama Lengkap</p>
|
||||
<Controller
|
||||
control={control}
|
||||
name="fullname"
|
||||
|
|
@ -210,12 +212,13 @@ export default function FormMasterUserEdit() {
|
|||
type="text"
|
||||
id="title"
|
||||
placeholder="Nama Lengkap..."
|
||||
label="Nama Lengkap"
|
||||
label=""
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
labelPlacement="outside"
|
||||
className="w-full"
|
||||
classNames={{
|
||||
input: "outline-none",
|
||||
inputWrapper: [
|
||||
"border-1 rounded-lg",
|
||||
"dark:group-data-[focused=false]:bg-transparent !border-1 dark:!border-gray-400",
|
||||
|
|
@ -228,6 +231,10 @@ export default function FormMasterUserEdit() {
|
|||
{errors.fullname?.message && (
|
||||
<p className="text-red-400 text-sm">{errors.fullname?.message}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">Username</p>
|
||||
|
||||
<Controller
|
||||
control={control}
|
||||
name="username"
|
||||
|
|
@ -236,7 +243,7 @@ export default function FormMasterUserEdit() {
|
|||
type="text"
|
||||
id="username"
|
||||
placeholder="Username..."
|
||||
label="Username"
|
||||
label=""
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
labelPlacement="outside"
|
||||
|
|
@ -254,6 +261,9 @@ export default function FormMasterUserEdit() {
|
|||
{errors.username?.message && (
|
||||
<p className="text-red-400 text-sm">{errors.username?.message}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">Email</p>
|
||||
|
||||
<Controller
|
||||
control={control}
|
||||
|
|
@ -263,7 +273,7 @@ export default function FormMasterUserEdit() {
|
|||
type="email"
|
||||
id="email"
|
||||
placeholder="Email..."
|
||||
label="Email"
|
||||
label=""
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
labelPlacement="outside"
|
||||
|
|
@ -281,7 +291,7 @@ export default function FormMasterUserEdit() {
|
|||
{errors.email?.message && (
|
||||
<p className="text-red-400 text-sm">{errors.email?.message}</p>
|
||||
)}
|
||||
|
||||
</div>
|
||||
{/* <Controller
|
||||
control={control}
|
||||
name="identityType"
|
||||
|
|
@ -306,6 +316,9 @@ export default function FormMasterUserEdit() {
|
|||
{errors.identityType?.message}
|
||||
</p>
|
||||
)} */}
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">NRP</p>
|
||||
|
||||
<Controller
|
||||
control={control}
|
||||
name="identityNumber"
|
||||
|
|
@ -314,7 +327,7 @@ export default function FormMasterUserEdit() {
|
|||
type="number"
|
||||
id="identityNumber"
|
||||
placeholder="NRP..."
|
||||
label="NRP"
|
||||
label=""
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
labelPlacement="outside"
|
||||
|
|
@ -334,13 +347,16 @@ export default function FormMasterUserEdit() {
|
|||
{errors.identityNumber?.message}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">Alamat</p>
|
||||
|
||||
<Controller
|
||||
control={control}
|
||||
name="address"
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Textarea
|
||||
label="Alamat"
|
||||
label=""
|
||||
labelPlacement="outside"
|
||||
placeholder="Alamat..."
|
||||
variant="bordered"
|
||||
|
|
@ -358,6 +374,9 @@ export default function FormMasterUserEdit() {
|
|||
{errors.address?.message && (
|
||||
<p className="text-red-400 text-sm">{errors.address?.message}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">Gender</p>
|
||||
|
||||
<Controller
|
||||
control={control}
|
||||
|
|
@ -365,7 +384,7 @@ export default function FormMasterUserEdit() {
|
|||
render={({ field: { onChange, value } }) => (
|
||||
<RadioGroup
|
||||
orientation="horizontal"
|
||||
label="Gender"
|
||||
label=""
|
||||
value={value}
|
||||
onValueChange={onChange}
|
||||
>
|
||||
|
|
@ -375,9 +394,12 @@ export default function FormMasterUserEdit() {
|
|||
)}
|
||||
/>
|
||||
{errors.genderType?.message && (
|
||||
<p className="text-red-400 text-sm">{errors.genderType?.message}</p>
|
||||
<p className="text-red-400 text-sm">
|
||||
{errors.genderType?.message}
|
||||
</p>
|
||||
)}
|
||||
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<Controller
|
||||
control={control}
|
||||
name="userLevelType"
|
||||
|
|
@ -410,6 +432,8 @@ export default function FormMasterUserEdit() {
|
|||
{errors.userLevelType?.message}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<Controller
|
||||
control={control}
|
||||
name="userRoleType"
|
||||
|
|
@ -442,6 +466,10 @@ export default function FormMasterUserEdit() {
|
|||
{errors.userRoleType?.message}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">No. Handphone</p>
|
||||
|
||||
<Controller
|
||||
control={control}
|
||||
name="phoneNumber"
|
||||
|
|
@ -450,7 +478,7 @@ export default function FormMasterUserEdit() {
|
|||
type="number"
|
||||
id="identityNumber"
|
||||
placeholder="08*********"
|
||||
label="No. Handphone"
|
||||
label=""
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
labelPlacement="outside"
|
||||
|
|
@ -464,7 +492,7 @@ export default function FormMasterUserEdit() {
|
|||
{errors.phoneNumber?.message}
|
||||
</p>
|
||||
)}
|
||||
|
||||
</div>
|
||||
<div className="flex justify-end gap-3">
|
||||
<Link href={`/admin/master-user`}>
|
||||
<Button color="danger" variant="ghost">
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ export async function setupEmail(data: any) {
|
|||
export async function getDetailMasterUsers(id: string) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGet(`/users/detail/${id}`, headers);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue