diff --git a/src/app/api/project/[id]/lainnya/route.ts b/src/app/api/project/[id]/lainnya/route.ts
new file mode 100644
index 0000000..2344a09
--- /dev/null
+++ b/src/app/api/project/[id]/lainnya/route.ts
@@ -0,0 +1,46 @@
+import { prisma } from "@/module/_global";
+import { funGetUserByCookies } from "@/module/auth";
+import { createLogUser } from "@/module/user";
+import { NextResponse } from "next/server";
+
+export async function DELETE(request: Request, context: { params: { id: string } }) {
+ try {
+ const user = await funGetUserByCookies()
+ if (user.id == undefined) {
+ return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 401 });
+ }
+
+ const { id } = context.params
+ const data = await prisma.project.count({
+ where: {
+ id: id,
+ }
+ })
+
+ if (data == 0) {
+ return NextResponse.json(
+ {
+ success: false, message: "Gagal mendapatkan kegiatan, data tidak ditemukan",
+ },
+ { status: 404 }
+ );
+ }
+
+ const dataDelete = await prisma.project.update({
+ where: {
+ id
+ },
+ data: {
+ isActive: false
+ }
+ })
+
+ // create log user
+ const log = await createLogUser({ act: 'DELETE', desc: 'User menghapus data kegiatan', table: 'project', data: String(id) })
+ return NextResponse.json({ success: true, message: "Kegiatan berhasil dihapus" }, { status: 200 });
+
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal menghapus kegiatan, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/task/[id]/lainnya/route.ts b/src/app/api/task/[id]/lainnya/route.ts
new file mode 100644
index 0000000..62a4265
--- /dev/null
+++ b/src/app/api/task/[id]/lainnya/route.ts
@@ -0,0 +1,48 @@
+import { prisma } from "@/module/_global";
+import { funGetUserByCookies } from "@/module/auth";
+import { createLogUser } from "@/module/user";
+import { NextResponse } from "next/server";
+
+// PEMBATALAN TASK DIVISI
+export async function DELETE(request: Request, context: { params: { id: string } }) {
+ try {
+ const user = await funGetUserByCookies()
+ if (user.id == undefined) {
+ return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 401 });
+ }
+
+ const { id } = context.params;
+ const data = await prisma.divisionProject.count({
+ where: {
+ id: id,
+ },
+ });
+
+ if (data == 0) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Penghapusan tugas gagal, data tugas tidak ditemukan",
+ },
+ { status: 404 }
+ );
+ }
+
+ const update = await prisma.divisionProject.update({
+ where: {
+ id
+ },
+ data: {
+ isActive: false,
+ }
+ });
+
+ // create log user
+ const log = await createLogUser({ act: 'DELETE', desc: 'User menghapus tugas divisi', table: 'divisionProject', data: id })
+
+ return NextResponse.json({ success: true, message: "Tugas berhasil dihapuskan", }, { status: 200 });
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal menghapus tugas, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/user/[id]/route.ts b/src/app/api/user/[id]/route.ts
index 9cb622f..c6d9fef 100644
--- a/src/app/api/user/[id]/route.ts
+++ b/src/app/api/user/[id]/route.ts
@@ -55,8 +55,9 @@ export async function GET(request: Request, context: { params: { id: string } })
const position = users?.Position.name
const idUserRole = users?.UserRole.id
const phone = users?.phone.substr(2)
+ const role = users?.UserRole.name
- const result = { ...userData, group, position, idUserRole, phone };
+ const result = { ...userData, group, position, idUserRole, phone, role };
const omitData = _.omit(result, ["Group", "Position", "UserRole"]);
diff --git a/src/app/api/user/profile/route.ts b/src/app/api/user/profile/route.ts
index 3a27995..21a3b20 100644
--- a/src/app/api/user/profile/route.ts
+++ b/src/app/api/user/profile/route.ts
@@ -36,6 +36,11 @@ export async function GET(request: Request) {
select: {
name: true
}
+ },
+ UserRole:{
+ select:{
+ name: true
+ }
}
}
})
@@ -43,10 +48,11 @@ export async function GET(request: Request) {
const group = data?.Group.name
const position = data?.Position.name
const phone = data?.phone.substr(2)
+ const role = data?.UserRole.name
- const omitData = _.omit(data, ["Group", "Position", "phone"])
+ const omitData = _.omit(data, ["Group", "Position", "phone", "UserRole"]);
- const result = { ...userData, group, position, phone };
+ const result = { ...userData, group, position, phone, role };
return NextResponse.json({ success: true, data: result });
} catch (error) {
diff --git a/src/app/api/version-app/route.ts b/src/app/api/version-app/route.ts
index 05b72d4..12b3be1 100644
--- a/src/app/api/version-app/route.ts
+++ b/src/app/api/version-app/route.ts
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
export async function GET(request: Request) {
try {
- return NextResponse.json({ success: true, version: "1.2.2", tahap: "beta", update:"-unshare dokumen divisi -jumlah dokumen pada detail divisi -tampil dokumen share pada detail divisi -loguser pada saat share dokumen divisi -boleh unduh file share" }, { status: 200 });
+ return NextResponse.json({ success: true, version: "1.2.3", tahap: "beta", update:"-nama grup darmasaba jadi lembaga desa, -menampilkan user role pada profile pada detail anggota, -fitur hapus pada data yg telah dibatalkan pada fitur kegiatan dan tugas divisi" }, { status: 200 });
} catch (error) {
console.error(error);
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
diff --git a/src/module/calender/ui/detail_event_division.tsx b/src/module/calender/ui/detail_event_division.tsx
index a118117..d917123 100644
--- a/src/module/calender/ui/detail_event_division.tsx
+++ b/src/module/calender/ui/detail_event_division.tsx
@@ -72,7 +72,7 @@ export default function DetailEventDivision() {
}
if (dataRealTime && dataRealTime.some((i: any) => i.category == 'calendar-detail-delete' && i.id == isDataCalender?.idCalendar && i.idUserFrom != isUserLogin)) {
- toast.error("Data telah di hapus, anda akan beralih ke halaman list acara")
+ toast.error("Data telah dihapus, anda akan beralih ke halaman list acara")
setTimeout(() => {
router.push(`/division/${param.id}/calender`)
}, 1000)
diff --git a/src/module/calender/ui/drawer_detail_event.tsx b/src/module/calender/ui/drawer_detail_event.tsx
index 2903bf9..3880d9a 100644
--- a/src/module/calender/ui/drawer_detail_event.tsx
+++ b/src/module/calender/ui/drawer_detail_event.tsx
@@ -1,15 +1,15 @@
"use client"
import { keyWibu, TEMA } from '@/module/_global';
import LayoutModal from '@/module/_global/layout/layout_modal';
+import { useHookstate } from '@hookstate/core';
import { Box, Flex, SimpleGrid, Stack, Text } from '@mantine/core';
import { useParams, useRouter } from 'next/navigation';
-import React, { useState } from 'react';
+import { useState } from 'react';
import toast from 'react-hot-toast';
-import { MdDelete, MdEdit } from 'react-icons/md';
-import { funDeleteCalenderById } from '../lib/api_calender';
-import { FaUsers } from 'react-icons/fa6';
-import { useHookstate } from '@hookstate/core';
+import { FaTrash, FaUsers } from 'react-icons/fa6';
+import { MdEdit } from 'react-icons/md';
import { useWibuRealtime } from 'wibu-realtime';
+import { funDeleteCalenderById } from '../lib/api_calender';
export default function DrawerDetailEvent({ idCalendar, close }: { idCalendar: string, close: (val: boolean) => void }) {
const router = useRouter()
@@ -82,7 +82,7 @@ export default function DrawerDetailEvent({ idCalendar, close }: { idCalendar: s
setModal(true)} justify={'center'} align={'center'} direction={'column'} >
-
+
Hapus Acara
diff --git a/src/module/discussion_general/ui/create_discussion.tsx b/src/module/discussion_general/ui/create_discussion.tsx
index bb3161e..b251af2 100644
--- a/src/module/discussion_general/ui/create_discussion.tsx
+++ b/src/module/discussion_general/ui/create_discussion.tsx
@@ -44,8 +44,8 @@ export default function FormCreateDiscussionGeneral() {
});
function onToChooseAnggota() {
- if (roleLogin.get() == "supadmin" && body.idGroup == "")
- return toast.error("Error! grup harus diisi")
+ if (roleLogin.get() == "supadmin" && (body.idGroup == "" || String(body.idGroup) == "null"))
+ return toast.error("Error! lembaga desa tidak boleh kosong")
setChooseAnggota(true)
}
@@ -158,8 +158,8 @@ export default function FormCreateDiscussionGeneral() {
{
(roleLogin.get() == "supadmin") && (
diff --git a/src/module/division_new/ui/create_division.tsx b/src/module/division_new/ui/create_division.tsx
index 3996563..dfb5293 100644
--- a/src/module/division_new/ui/create_division.tsx
+++ b/src/module/division_new/ui/create_division.tsx
@@ -59,8 +59,8 @@ export default function CreateDivision() {
}
function onToChooseAnggota() {
- if (roleUser == "supadmin" && body.idGroup == "")
- return toast.error("Error! grup harus diisi")
+ if (roleUser == "supadmin" && (body.idGroup == "" || String(body.idGroup) == "null"))
+ return toast.error("Error! lembaga desa tidak boleh kosong")
setChooseAnggota(true)
}
@@ -147,8 +147,8 @@ export default function CreateDivision() {
{
(roleUser == "supadmin") && (
- Tambah Darmasaba
+ Tambah Lembaga Desa
@@ -86,7 +86,7 @@ export default function DrawerGroup({ onSuccess, }: { onSuccess: (val: boolean)
setOpenDrawerGroup(false)}
- title={"Tambah Darmasaba"}
+ title={"Tambah Lembaga Desa"}
>
{
onValidation('name', e.target.value)
}}
diff --git a/src/module/group/ui/edit_drawer_group.tsx b/src/module/group/ui/edit_drawer_group.tsx
index 92ce626..0137be8 100644
--- a/src/module/group/ui/edit_drawer_group.tsx
+++ b/src/module/group/ui/edit_drawer_group.tsx
@@ -139,7 +139,7 @@ export default function EditDrawerGroup({ onUpdated, id, isActive, }: { onUpdate
setOpenDrawerGroup(false)}
- title={"Edit Darmasaba"}
+ title={"Edit Lembaga Desa"}
>
diff --git a/src/module/group/ui/list_group_active.tsx b/src/module/group/ui/list_group_active.tsx
index 32edbb5..7567e8f 100644
--- a/src/module/group/ui/list_group_active.tsx
+++ b/src/module/group/ui/list_group_active.tsx
@@ -43,7 +43,7 @@ export default function ListGroupActive() {
setLoading(false);
} catch (error) {
- toast.error("Gagal mendapatkan grup, coba lagi nanti");
+ toast.error("Gagal mendapatkan lembaga desa, coba lagi nanti");
console.error(error);
} finally {
setLoading(false);
diff --git a/src/module/group/ui/navbar_group.tsx b/src/module/group/ui/navbar_group.tsx
index 5cdea6a..4612fce 100644
--- a/src/module/group/ui/navbar_group.tsx
+++ b/src/module/group/ui/navbar_group.tsx
@@ -11,7 +11,7 @@ export default function NavbarGroup() {
const tema = useHookstate(TEMA)
return (
<>
- setOpen(true)} variant="light" bg={tema.get().bgIcon} size="lg" radius="lg" aria-label="Settings">
diff --git a/src/module/home/ui/view_detail_feature.tsx b/src/module/home/ui/view_detail_feature.tsx
index d5cca9d..660f438 100644
--- a/src/module/home/ui/view_detail_feature.tsx
+++ b/src/module/home/ui/view_detail_feature.tsx
@@ -155,7 +155,7 @@ export default function ViewDetailFeature() {
- Darmasaba
+ Lembaga Desa
router.push('/color-palette')}>
diff --git a/src/module/position/ui/drawer_list_position.tsx b/src/module/position/ui/drawer_list_position.tsx
index ccb8cdc..5eb48d9 100644
--- a/src/module/position/ui/drawer_list_position.tsx
+++ b/src/module/position/ui/drawer_list_position.tsx
@@ -157,8 +157,8 @@ export default function DrawerListPosition({ onCreated }: { onCreated: (val: boo
{
roleLogin.get() == "supadmin" &&
({
@@ -181,7 +181,7 @@ export default function DrawerListPosition({ onCreated }: { onCreated: (val: boo
}}
error={
touched.idGroup && (
- listData.idGroup == "" || String(listData.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null
+ listData.idGroup == "" || String(listData.idGroup) == "null" ? "Lembaga Desa Tidak Boleh Kosong" : null
)
}
/>
diff --git a/src/module/project/lib/api_project.ts b/src/module/project/lib/api_project.ts
index c3dee5b..255faae 100644
--- a/src/module/project/lib/api_project.ts
+++ b/src/module/project/lib/api_project.ts
@@ -19,7 +19,7 @@ export const funGetOneProjectById = async (path: string, kategori: string) => {
return await response.json().catch(() => null);
}
-export const funGetAllMemberById = async (path?: string, id?:string) => {
+export const funGetAllMemberById = async (path?: string, id?: string) => {
const response = await fetch(`/api/project/${id}/member/${path}`);
return await response.json().catch(() => null);
}
@@ -148,3 +148,14 @@ export const funAddFileProject = async (path: string, data: FormData) => {
});
return await response.json().catch(() => null);
};
+
+export const funDeleteProject = async (path: string) => {
+ const response = await fetch(`/api/project/${path}/lainnya`, {
+ method: "DELETE",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
diff --git a/src/module/project/ui/create_project.tsx b/src/module/project/ui/create_project.tsx
index 886a919..53db4e3 100644
--- a/src/module/project/ui/create_project.tsx
+++ b/src/module/project/ui/create_project.tsx
@@ -84,8 +84,8 @@ export default function CreateProject() {
}
function onToChooseAnggota() {
- if (roleLogin.get() == "supadmin" && body.idGroup == "")
- return toast.error("Error! grup harus diisi")
+ if (roleLogin.get() == "supadmin" && (body.idGroup == "" || String(body.idGroup) == "null"))
+ return toast.error("Error! lembaga desa tidak boleh kosong")
setChooseAnggota(true)
}
@@ -196,8 +196,8 @@ export default function CreateProject() {
{
(roleLogin.get() == "supadmin") && (
diff --git a/src/module/project/ui/navbar_detail_project.tsx b/src/module/project/ui/navbar_detail_project.tsx
index 2444f20..8d06e0c 100644
--- a/src/module/project/ui/navbar_detail_project.tsx
+++ b/src/module/project/ui/navbar_detail_project.tsx
@@ -1,17 +1,18 @@
'use client'
import { globalRole, keyWibu, LayoutDrawer, LayoutNavbarNew, TEMA } from '@/module/_global';
+import LayoutModal from '@/module/_global/layout/layout_modal';
import { useHookstate } from '@hookstate/core';
import { ActionIcon, Box, Flex, SimpleGrid, Stack, Text } from '@mantine/core';
import { useShallowEffect } from '@mantine/hooks';
import { useParams, useRouter } from 'next/navigation';
import { useState } from 'react';
import toast from 'react-hot-toast';
-import { FaFileCirclePlus, FaPencil, FaUsers } from 'react-icons/fa6';
+import { FaFileCirclePlus, FaPencil, FaTrash, FaUsers } from 'react-icons/fa6';
import { HiMenu } from 'react-icons/hi';
import { IoAddCircle } from 'react-icons/io5';
import { MdCancel } from 'react-icons/md';
import { useWibuRealtime } from 'wibu-realtime';
-import { funGetOneProjectById } from '../lib/api_project';
+import { funDeleteProject, funGetOneProjectById } from '../lib/api_project';
import { globalIsMemberProject } from '../lib/val_project';
export default function NavbarDetailProject() {
@@ -24,6 +25,8 @@ export default function NavbarDetailProject() {
const memberProject = useHookstate(globalIsMemberProject)
const tema = useHookstate(TEMA)
const [reason, setReason] = useState("")
+ const [openModal, setOpenModal] = useState(false)
+ const [loadingModal, setLoadingModal] = useState(false)
const [dataRealTime, setDataRealtime] = useWibuRealtime({
WIBU_REALTIME_TOKEN: keyWibu,
project: "sdm"
@@ -39,10 +42,32 @@ export default function NavbarDetailProject() {
} else {
toast.error(res.message);
}
-
} catch (error) {
console.error(error);
- toast.error("Gagal mendapatkan data Kegiatan, coba lagi nanti");
+ toast.error("Gagal mendapatkan data kegiatan, coba lagi nanti");
+ }
+ }
+
+ async function deleteDataProject() {
+ try {
+ setLoadingModal(true)
+ const res = await funDeleteProject(param.id);
+ if (res.success) {
+ setDataRealtime([{
+ category: "project-delete",
+ id: param.id,
+ }])
+ toast.success(res.message)
+ router.push("/project")
+ } else {
+ toast.error(res.message)
+ }
+ } catch (error) {
+ console.error(error);
+ toast.error("Gagal menghapus data kegiatan, coba lagi nanti");
+ } finally {
+ setLoadingModal(false)
+ setOpenModal(false)
}
}
@@ -54,6 +79,13 @@ export default function NavbarDetailProject() {
if (dataRealTime && dataRealTime.some((i: any) => (i.category == 'project-detail' || i.category == 'project-detail-status') && i.id == param.id)) {
getOneData()
}
+
+ if (dataRealTime && dataRealTime.some((i: any) => (i.category == 'project-delete') && i.id == param.id)) {
+ toast.error("Data telah dihapus, anda akan beralih ke halaman list kegiatan")
+ setTimeout(() => {
+ router.push("/project")
+ }, 1000)
+ }
}, [dataRealTime])
return (
@@ -158,24 +190,34 @@ export default function NavbarDetailProject() {
Edit
-
- {
- reason == null ?
- router.push(param.id + '/cancel')
- : null
- }}
- >
-
-
-
-
- Batal
-
-
+ {
+ reason == null ?
+ {
+ reason == null ?
+ router.push(param.id + '/cancel')
+ : null
+ }}
+ >
+
+
+
+
+ Batal
+
+
+ :
+ { setOpenModal(true) }}
+ >
+
+
+
+
+ Hapus
+
+
+ }
>
}
@@ -183,6 +225,10 @@ export default function NavbarDetailProject() {
+
+ setOpenModal(false)}
+ description="Apakah Anda yakin ingin menghapus kegiatan ini?"
+ onYes={(val) => { val ? deleteDataProject() : setOpenModal(false) }} />
>
);
}
diff --git a/src/module/task/lib/api_task.ts b/src/module/task/lib/api_task.ts
index afe2fac..077bd98 100644
--- a/src/module/task/lib/api_task.ts
+++ b/src/module/task/lib/api_task.ts
@@ -144,4 +144,14 @@ export const funAddFileTask = async (path: string, data: FormData) => {
body: data,
});
return await response.json().catch(() => null);
+};
+
+export const funDeleteTask = async (path: string) => {
+ const response = await fetch(`/api/task/${path}/lainnya`, {
+ method: "DELETE",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+ return await response.json().catch(() => null);
};
\ No newline at end of file
diff --git a/src/module/task/ui/navbar_detail_division_task.tsx b/src/module/task/ui/navbar_detail_division_task.tsx
index 1ca37c6..ca8b9b1 100644
--- a/src/module/task/ui/navbar_detail_division_task.tsx
+++ b/src/module/task/ui/navbar_detail_division_task.tsx
@@ -7,12 +7,13 @@ import { useShallowEffect } from "@mantine/hooks";
import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import toast from "react-hot-toast";
-import { FaFileCirclePlus, FaPencil, FaUsers } from "react-icons/fa6";
+import { FaFileCirclePlus, FaPencil, FaTrash, FaUsers } from "react-icons/fa6";
import { HiMenu } from "react-icons/hi";
import { IoAddCircle } from "react-icons/io5";
import { MdCancel } from "react-icons/md";
-import { funGetTaskDivisionById } from "../lib/api_task";
+import { funDeleteTask, funGetTaskDivisionById } from "../lib/api_task";
import { useWibuRealtime } from "wibu-realtime";
+import LayoutModal from "@/module/_global/layout/layout_modal";
export default function NavbarDetailDivisionTask() {
const router = useRouter()
@@ -24,6 +25,8 @@ export default function NavbarDetailDivisionTask() {
const memberDivision = useHookstate(globalIsMemberDivision)
const tema = useHookstate(TEMA)
const [reason, setReason] = useState("")
+ const [loadingModal, setLoadingModal] = useState(false)
+ const [openModal, setOpenModal] = useState(false)
const [dataRealTime, setDataRealtime] = useWibuRealtime({
WIBU_REALTIME_TOKEN: keyWibu,
project: "sdm"
@@ -45,6 +48,29 @@ export default function NavbarDetailDivisionTask() {
}
}
+ async function deleteDataProject() {
+ try {
+ setLoadingModal(true)
+ const res = await funDeleteTask(param.detail);
+ if (res.success) {
+ setDataRealtime([{
+ category: "tugas-delete",
+ id: param.detail,
+ }])
+ toast.success(res.message)
+ router.push("/division/" + param.id + "/task")
+ } else {
+ toast.error(res.message)
+ }
+ } catch (error) {
+ console.error(error);
+ toast.error("Gagal menghapus data tugas divisi, coba lagi nanti");
+ } finally {
+ setLoadingModal(false)
+ setOpenModal(false)
+ }
+ }
+
useShallowEffect(() => {
getOneData();
}, [param.detail])
@@ -54,6 +80,13 @@ export default function NavbarDetailDivisionTask() {
if (dataRealTime && dataRealTime.some((i: any) => (i.category == 'tugas-detail' || i.category == 'tugas-detail-status') && i.id == param.detail)) {
getOneData()
}
+
+ if (dataRealTime && dataRealTime.some((i: any) => i.category == 'tugas-delete' && i.id == param.detail)) {
+ toast.error("Data telah dihapus, anda akan beralih ke halaman list tugas divisi")
+ setTimeout(() => {
+ router.push("/division/" + param.id + "/task")
+ }, 1000)
+ }
}, [dataRealTime])
return (
@@ -156,23 +189,39 @@ export default function NavbarDetailDivisionTask() {
Edit
+ {
+ reason == null ?
+ {
+ reason == null ?
+ router.push(param.detail + '/cancel')
+ : null
+ }} >
+
+
+
+
+ Batal
+
+
+ :
+ { setOpenModal(true) }} >
+
+
+
+
+ Hapus
+
+
+ }
- {
- reason == null ?
- router.push(param.detail + '/cancel')
- : null
- }} >
-
-
-
-
- Batal
-
-
> : <>>
}
@@ -182,6 +231,10 @@ export default function NavbarDetailDivisionTask() {
+
+ setOpenModal(false)}
+ description="Apakah Anda yakin ingin menghapus tugas divisi ini?"
+ onYes={(val) => { val ? deleteDataProject() : setOpenModal(false) }} />
>
)
}
\ No newline at end of file
diff --git a/src/module/user/member/lib/type_member.ts b/src/module/user/member/lib/type_member.ts
index 3d3f2ba..60be080 100644
--- a/src/module/user/member/lib/type_member.ts
+++ b/src/module/user/member/lib/type_member.ts
@@ -8,7 +8,8 @@ export interface IListMember {
position: string,
group: string,
img: string,
- isActive: boolean
+ isActive: boolean,
+ role: string
}
export interface IFormMember {
diff --git a/src/module/user/member/ui/create_member.tsx b/src/module/user/member/ui/create_member.tsx
index 64105d2..dde08e4 100644
--- a/src/module/user/member/ui/create_member.tsx
+++ b/src/module/user/member/ui/create_member.tsx
@@ -66,7 +66,7 @@ export default function CreateMember() {
}
} catch (error) {
console.error(error);
- toast.error("Gagal mendapatkan grup, coba lagi nanti");
+ toast.error("Gagal mendapatkan lembaga desa, coba lagi nanti");
}
}
@@ -300,8 +300,8 @@ export default function CreateMember() {
{
roleLogin.get() == "supadmin" &&
{ changeGrup(val) }}
error={
touched.idGroup && (
- listData.idGroup == "" || String(listData.idGroup) == "null" ? "Grup Tidak Boleh Kosong" : null
+ listData.idGroup == "" || String(listData.idGroup) == "null" ? "Lembaga Desa Tidak Boleh Kosong" : null
)
}
/>
diff --git a/src/module/user/member/ui/navbar_detail_member.tsx b/src/module/user/member/ui/navbar_detail_member.tsx
index c3123ab..176e17f 100644
--- a/src/module/user/member/ui/navbar_detail_member.tsx
+++ b/src/module/user/member/ui/navbar_detail_member.tsx
@@ -5,7 +5,7 @@ import { ActionIcon, Avatar, Box, Center, Grid, Group, Skeleton, Stack, Text } f
import { useShallowEffect } from "@mantine/hooks";
import { useState } from "react";
import toast from "react-hot-toast";
-import { FaSquarePhone } from "react-icons/fa6";
+import { FaBuildingUser, FaSquarePhone } from "react-icons/fa6";
import { HiMenu } from "react-icons/hi";
import { IoMaleFemale } from "react-icons/io5";
import { MdEmail } from "react-icons/md";
@@ -14,6 +14,8 @@ import { valueRoleUser } from "../../lib/val_user";
import { funGetOneMember } from "../lib/api_member";
import { IListMember, IMember } from "../lib/type_member";
import DrawerDetailMember from "./drawer_detail_member";
+import { BiSolidUserBadge } from "react-icons/bi";
+import { PiGenderIntersexFill } from "react-icons/pi";
export default function NavbarDetailMember({ id }: IMember) {
@@ -47,7 +49,7 @@ export default function NavbarDetailMember({ id }: IMember) {
setLoading(false)
} catch (error) {
console.error(error)
- toast.error("Gagal mendapatkan detail user, coba lagi nanti");
+ toast.error("Gagal mendapatkan detail anggota, coba lagi nanti");
} finally {
setLoading(false)
}
@@ -89,7 +91,7 @@ export default function NavbarDetailMember({ id }: IMember) {
:
<>
{dataOne?.name}
- {dataOne?.group} - {dataOne?.position}
+ {dataOne?.role}
>
}
@@ -113,6 +115,28 @@ export default function NavbarDetailMember({ id }: IMember) {
{dataOne?.nik}
+
+
+
+
+ Lembaga Desa
+
+
+
+ {dataOne?.group}
+
+
+
+
+
+
+ Jabatan
+
+
+
+ {dataOne?.position}
+
+
@@ -138,7 +162,7 @@ export default function NavbarDetailMember({ id }: IMember) {
-
+
Jenis Kelamin
diff --git a/src/module/user/profile/lib/type_profile.ts b/src/module/user/profile/lib/type_profile.ts
index fa386ad..c176c9f 100644
--- a/src/module/user/profile/lib/type_profile.ts
+++ b/src/module/user/profile/lib/type_profile.ts
@@ -9,6 +9,7 @@ export interface IProfileById {
idPosition: string
group: string
position: string
+ role:string
}
export interface IEditDataProfile {
diff --git a/src/module/user/profile/ui/profile.tsx b/src/module/user/profile/ui/profile.tsx
index c3af99e..2013722 100644
--- a/src/module/user/profile/ui/profile.tsx
+++ b/src/module/user/profile/ui/profile.tsx
@@ -7,10 +7,11 @@ import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import { useState } from "react";
import toast from "react-hot-toast";
-import { FaSquarePhone } from "react-icons/fa6";
-import { IoMaleFemale } from "react-icons/io5";
+import { BiSolidUserBadge } from "react-icons/bi";
+import { FaBuildingUser, FaSquarePhone } from "react-icons/fa6";
import { LuLogOut } from "react-icons/lu";
import { MdEmail } from "react-icons/md";
+import { PiGenderIntersexFill } from "react-icons/pi";
import { RiIdCardFill } from "react-icons/ri";
import { funGetProfileByCookies } from "../lib/api_profile";
import { IProfileById } from "../lib/type_profile";
@@ -88,7 +89,7 @@ export default function Profile() {
:
<>
{isData?.name}
- {isData?.group} - {isData?.position}
+ {isData?.role}
>
}
@@ -115,6 +116,28 @@ export default function Profile() {
{isData?.nik}
+
+
+
+
+ Lembaga Desa
+
+
+
+ {isData?.group}
+
+
+
+
+
+
+ Jabatan
+
+
+
+ {isData?.position}
+
+
@@ -140,7 +163,7 @@ export default function Profile() {
-
+
Jenis Kelamin