Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Super admin #36

Merged
merged 34 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3252210
new dev
DimzsArdiminda Jan 7, 2025
275e67a
feat: db seed
DimzsArdiminda Jan 7, 2025
048bbda
feat: show on table
DimzsArdiminda Jan 7, 2025
3faba8b
feat: show by slug
DimzsArdiminda Jan 7, 2025
3e51322
feat: show by slug (fiks)
DimzsArdiminda Jan 7, 2025
5380709
feat: add artikel
DimzsArdiminda Jan 7, 2025
53dfa15
fiks: bug button back
DimzsArdiminda Jan 7, 2025
3727fc3
fiks: coloumn on article
DimzsArdiminda Jan 7, 2025
fca8a89
fiks: double slug
DimzsArdiminda Jan 7, 2025
f093d0d
fiks: ui show-article
DimzsArdiminda Jan 7, 2025
2f7311c
on dev
DimzsArdiminda Jan 8, 2025
315f6ea
Merge branch 'main' of https://github.com/gdsc-um/homesite-refactor i…
DimzsArdiminda Jan 8, 2025
0d21ab9
feat: update
DimzsArdiminda Jan 8, 2025
d534c9d
feat: delete
DimzsArdiminda Jan 8, 2025
b6c2e2f
feat: search
DimzsArdiminda Jan 8, 2025
1ef67d3
feat: show artikel on dashboard
DimzsArdiminda Jan 8, 2025
8f6e2e2
feat: show artikel on blog
DimzsArdiminda Jan 8, 2025
b85a265
feat: show list user on admin's dashboard
DimzsArdiminda Jan 8, 2025
574f230
feat: show list user on member's dashboard
DimzsArdiminda Jan 8, 2025
c71c04c
feat: delete user
DimzsArdiminda Jan 9, 2025
09e10fb
build: update user
DimzsArdiminda Jan 9, 2025
50cf8d9
feat: add user
DimzsArdiminda Jan 9, 2025
63102f3
feat: add user
DimzsArdiminda Jan 9, 2025
a2f6be9
feat: mboh lali garap opo
DimzsArdiminda Jan 9, 2025
da9cc9c
feat: search on manage user
DimzsArdiminda Jan 9, 2025
36a3834
fiks: build error
DimzsArdiminda Jan 9, 2025
fa12fc2
fiks: build error 2
DimzsArdiminda Jan 9, 2025
abcfdb8
fiks: build error 3
DimzsArdiminda Jan 9, 2025
c3a8a35
fiks: build error 4
DimzsArdiminda Jan 9, 2025
6e26f6e
fiks: build error 5
DimzsArdiminda Jan 9, 2025
69758ac
fiks: build error 5
DimzsArdiminda Jan 9, 2025
830df2a
Merge branch 'main' of https://github.com/gdsc-um/homesite-refactor i…
DimzsArdiminda Jan 12, 2025
ccdcd4f
Merge branch 'main' of https://github.com/gdsc-um/homesite-refactor i…
DimzsArdiminda Jan 14, 2025
3974482
fiks bug: fiks bug add on user
DimzsArdiminda Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions app/admin/dashboard/manage-user/components/userForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const UserForm: FC<UserFormProps> = ({ user, type }) => {

const formData = new FormData(e.currentTarget);
const data = Object.fromEntries(formData.entries());
if (!updatePassword) {
if (type === "EDIT" && !updatePassword) {
delete data.password; // Hapus password jika user memilih tidak mengupdate password
}
const method = type === "EDIT" ? "PUT" : "POST";
Expand All @@ -56,6 +56,7 @@ const UserForm: FC<UserFormProps> = ({ user, type }) => {
toast.error("An error occurred while submitting the form");
}
};

return (
<>
<form className="flex flex-col gap-6" onSubmit={handleSubmit}>
Expand Down Expand Up @@ -101,32 +102,33 @@ const UserForm: FC<UserFormProps> = ({ user, type }) => {
readOnly={type === "EDIT"}
/>
</div>
{type === "EDIT" && (
<div className="space-y-1 md:space-y-2">
<Label>
<input
type="checkbox"
checked={updatePassword}
onChange={(e) => setUpdatePassword(e.target.checked)}
{/* Form password hanya muncul saat ADD atau saat EDIT jika memilih update password */}
{(type === "ADD" || updatePassword) && (
<div className="space-y-1 md:space-y-2">
<Label className="text-lg " htmlFor="password">
Password
</Label>
<Input
type="text"
defaultValue=""
name="password"
id="password"
required={type === "ADD"}
/>
<p>Update Password</p>
</Label>
</div>
)}
{updatePassword && (
<div className="space-y-1 md:space-y-2">
<Label className="text-lg " htmlFor="password">
Password
</Label>
<Input
type="text"
defaultValue=""
name="password"
id="password"
required
/>
</div>
)}
</div>
)}
{type === "EDIT" && (
<div className="space-y-1 md:space-y-2">
<Label>
<input
type="checkbox"
checked={updatePassword}
onChange={(e) => setUpdatePassword(e.target.checked)}
/>
<p>Update Password</p>
</Label>
</div>
)}
<div className="space-y-1 md:space-y-2">
<Label className="text-lg " htmlFor="profil_bevy">
Profile Bevy
Expand Down
Loading
Loading