diff --git a/pages/adminkursus/edit/[id].jsx b/pages/adminkursus/edit/[id].jsx index c16f742770e62dd63f2417a0f03e12e42df72e49..b28de815c77290e26df85307f0741bca38ee4816 100644 --- a/pages/adminkursus/edit/[id].jsx +++ b/pages/adminkursus/edit/[id].jsx @@ -18,7 +18,7 @@ const Edit = () => { } const body = JSON.stringify({ username, - password + password: password || undefined }) const updateQuery = await fetch("https://rpl-backend-production.up.railway.app/v1/adminkursus/update/" + router.query.id, { method: "PATCH", @@ -79,6 +79,7 @@ const Edit = () => { handleUpdate() return; }}> + <div className="flex flex-row align-middle justify-between"> <span className="h-min my-auto font-bold text-lg">user_id</span> <input disabled value={user_id} type="tel" required className="drop-shadow-xl w-2/3 p-2 rounded-xl" /> @@ -87,13 +88,13 @@ const Edit = () => { <span className="h-min my-auto font-bold text-lg">Username</span> <input value={username} onChange={(e) => { setusername(e.target.value) - }} type="text" className="drop-shadow-xl w-2/3 p-2 rounded-xl" /> + }} type="text" className="drop-shadow-xl w-2/3 p-2 rounded-xl" /> </div> <div className="flex flex-row align-middle justify-between"> <span className="h-min my-auto font-bold text-lg">Password</span> <input value={password} onChange={(e) => { setpassword(e.target.value) - }} type="password" className="drop-shadow-xl w-2/3 p-2 rounded-xl" /> + }} type="password" className="drop-shadow-xl w-2/3 p-2 rounded-xl" /> </div> <input type="submit" className="bg-[#F875AA] px-8 py-3 text-xl font-bold text-white rounded-xl mx-auto" value={"Simpan"} />