upd: api address
Deskripsi: - hapus semua penggunaan api address - fungetall member in index No Issues
This commit is contained in:
@@ -1,45 +0,0 @@
|
|||||||
export const API_ADDRESS = {
|
|
||||||
// Group
|
|
||||||
"apiGetAllGroup": "/api/group/get?path=get-all-group",
|
|
||||||
"apiGetOneGroup": "/api/group/get?path=get-one-group",
|
|
||||||
"apiCreateGroup": "/api/group/post?path=create-group",
|
|
||||||
"apiUpdateGroup": "/api/group/post?path=update-group",
|
|
||||||
"apiDeleteGroup": "/api/group/post?path=delete-group",
|
|
||||||
|
|
||||||
// User
|
|
||||||
"apiGetAllUser": "/api/user/get?path=get-all-users",
|
|
||||||
"apiGetOneUser": "/api/user/get?path=get-one-users",
|
|
||||||
"apiCreateUser": "/api/user/post?path=create-users",
|
|
||||||
"apiUpdateUser": "/api/user/post?path=update-users",
|
|
||||||
"apiDeleteUser": "/api/user/post?path=delete-users",
|
|
||||||
"apiGetRoleUser": "/api/user/get?path=get-role-user",
|
|
||||||
|
|
||||||
// Announcement
|
|
||||||
"apiGetAllAnnouncement": "/api/announcement/get?path=get-all-announcement",
|
|
||||||
"apiGetOneAnnouncement": "/api/announcement/get?path=get-one-announcement",
|
|
||||||
"apiGetUserAnnouncement": "/api/announcement/get?path=get-user-announcement",
|
|
||||||
"apiCreateAnnouncement": "/api/announcement/post?path=create-announcement",
|
|
||||||
"apiUpdateAnnouncement": "/api/announcement/post?path=update-announcement",
|
|
||||||
"apiDeleteAnnouncement": "/api/announcement/post?path=delete-announcement",
|
|
||||||
|
|
||||||
// Village
|
|
||||||
"apiGetAllVillage": "/api/village/get?path=get-all-village",
|
|
||||||
"apiGetOneVillage": "/api/village/get?path=get-one-village",
|
|
||||||
"apiCreateVillage": "/api/village/post?path=create-village",
|
|
||||||
"apiUpdateVillage": "/api/village/post?path=update-village",
|
|
||||||
"apiDeleteVillage": "/api/village/post?path=delete-village",
|
|
||||||
|
|
||||||
// Position
|
|
||||||
"apiGetAllPosition": "/api/position/get?path=get-all-position",
|
|
||||||
"apiGetOnePosition": "/api/position/get?path=get-one-position",
|
|
||||||
"apiCreatePosition": "/api/position/post?path=create-position",
|
|
||||||
"apiUpdatePosition": "/api/position/post?path=update-position",
|
|
||||||
"apiDeletePosition": "/api/position/post?path=delete-position",
|
|
||||||
|
|
||||||
|
|
||||||
// Division
|
|
||||||
"apiGetAllDivision": "/api/division/get?path=get-all-division",
|
|
||||||
"apiGetOneDivision": "/api/division/get?path=get-one-division",
|
|
||||||
"apiGetOneDetailDivision": "/api/division/get?path=get-one-detail-division",
|
|
||||||
"apiCreateDivision": "/api/division/post?path=create-division",
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import { API_ADDRESS } from "./bin/api_address";
|
|
||||||
import prisma from "./bin/prisma";
|
import prisma from "./bin/prisma";
|
||||||
import { pwd_key_config } from "./bin/val_global";
|
import { pwd_key_config } from "./bin/val_global";
|
||||||
import SkeletonSingle from "./components/skeleton_single";
|
import SkeletonSingle from "./components/skeleton_single";
|
||||||
@@ -21,5 +20,4 @@ export { LayoutNavbarNew };
|
|||||||
export { ViewFilter };
|
export { ViewFilter };
|
||||||
export { prisma };
|
export { prisma };
|
||||||
export { pwd_key_config };
|
export { pwd_key_config };
|
||||||
export { API_ADDRESS };
|
|
||||||
export {SkeletonSingle}
|
export {SkeletonSingle}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { API_ADDRESS } from "@/module/_global";
|
|
||||||
import { Box, Flex, Grid, Group, Spoiler, Stack, Text } from "@mantine/core";
|
import { Box, Flex, Grid, Group, Spoiler, Stack, Text } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { API_ADDRESS, WARNA } from '@/module/_global';
|
import { WARNA } from '@/module/_global';
|
||||||
import { ActionIcon, Box, Center, Divider, Grid, Group, Spoiler, Text, TextInput } from '@mantine/core';
|
import { ActionIcon, Box, Center, Divider, Grid, Group, Spoiler, Text, TextInput } from '@mantine/core';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { TfiAnnouncement } from "react-icons/tfi";
|
import { TfiAnnouncement } from "react-icons/tfi";
|
||||||
|
|||||||
@@ -1,53 +1,18 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { API_ADDRESS, LayoutNavbarNew, WARNA } from '@/module/_global';
|
import { LayoutNavbarNew, WARNA } from '@/module/_global';
|
||||||
import LayoutModal from '@/module/_global/layout/layout_modal';
|
import LayoutModal from '@/module/_global/layout/layout_modal';
|
||||||
import { funGetUserByCookies } from '@/module/auth';
|
import { funGetUserByCookies } from '@/module/auth';
|
||||||
import { TypeUser } from '@/module/user';
|
import { funGetAllmember, TypeUser } from '@/module/user';
|
||||||
import { useHookstate } from '@hookstate/core';
|
|
||||||
import { Avatar, Box, Button, Divider, Group, Stack, Text, TextInput } from '@mantine/core';
|
import { Avatar, Box, Button, Divider, Group, Stack, Text, TextInput } from '@mantine/core';
|
||||||
import { useParams, useRouter } from 'next/navigation';
|
import { useParams, useRouter } from 'next/navigation';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
import { FaCheck } from 'react-icons/fa6';
|
import { FaCheck } from 'react-icons/fa6';
|
||||||
import { HiMagnifyingGlass } from 'react-icons/hi2';
|
import { HiMagnifyingGlass } from 'react-icons/hi2';
|
||||||
import { globalMemberDivision } from '../lib/val_division';
|
|
||||||
import { useShallowEffect } from '@mantine/hooks';
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
import { funGetAllmember } from '@/module/user/member/lib/api_member';
|
|
||||||
import { IDataMemberDivision } from '../lib/type_division';
|
import { IDataMemberDivision } from '../lib/type_division';
|
||||||
import { funAddDivisionMember, funGetDivisionById } from '../lib/api_division';
|
import { funAddDivisionMember, funGetDivisionById } from '../lib/api_division';
|
||||||
|
|
||||||
const dataUser = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
img: "https://i.pravatar.cc/1000?img=3",
|
|
||||||
name: "Doni Setiawan",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
img: "https://i.pravatar.cc/1000?img=10",
|
|
||||||
name: "Ilham Udin",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
img: "https://i.pravatar.cc/1000?img=11",
|
|
||||||
name: "Didin Anang",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
img: "https://i.pravatar.cc/1000?img=21",
|
|
||||||
name: "Angga Saputra",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
img: "https://i.pravatar.cc/1000?img=32",
|
|
||||||
name: "Marcel Widianto",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
img: "https://i.pravatar.cc/1000?img=37",
|
|
||||||
name: "Bagas Nusantara",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function CreateAnggotaDivision() {
|
export default function CreateAnggotaDivision() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { API_ADDRESS, LayoutNavbarNew, WARNA } from "@/module/_global";
|
import { LayoutNavbarNew, WARNA } from "@/module/_global";
|
||||||
import { useHookstate } from "@hookstate/core";
|
import { useHookstate } from "@hookstate/core";
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { API_ADDRESS, LayoutDrawer, LayoutNavbarNew, WARNA } from '@/module/_global';
|
import { LayoutDrawer, LayoutNavbarNew, WARNA } from '@/module/_global';
|
||||||
import { ActionIcon, Avatar, Box, Card, Center, Divider, Flex, Grid, Group, Text, TextInput, Title } from '@mantine/core';
|
import { ActionIcon, Avatar, Box, Card, Center, Divider, Flex, Grid, Group, Text, TextInput, Title } from '@mantine/core';
|
||||||
import { useRouter, useSearchParams } from 'next/navigation';
|
import { useRouter, useSearchParams } from 'next/navigation';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { API_ADDRESS, LayoutNavbarNew, WARNA } from '@/module/_global';
|
import { LayoutNavbarNew, WARNA } from '@/module/_global';
|
||||||
import { useHookstate } from '@hookstate/core';
|
import { useHookstate } from '@hookstate/core';
|
||||||
import { Avatar, Box, Button, Checkbox, Divider, Flex, Group, Stack, Text, TextInput } from '@mantine/core';
|
import { Avatar, Box, Button, Checkbox, Divider, Flex, Group, Stack, Text, TextInput } from '@mantine/core';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { API_ADDRESS, LayoutNavbarNew, WARNA } from '@/module/_global';
|
import { LayoutNavbarNew, WARNA } from '@/module/_global';
|
||||||
import { useHookstate } from '@hookstate/core';
|
import { useHookstate } from '@hookstate/core';
|
||||||
import { Avatar, Box, Button, Center, Input, SimpleGrid, Stack, Text, TextInput } from '@mantine/core';
|
import { Avatar, Box, Button, Center, Input, SimpleGrid, Stack, Text, TextInput } from '@mantine/core';
|
||||||
import { useShallowEffect } from '@mantine/hooks';
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { HiMagnifyingGlass } from 'react-icons/hi2';
|
import { HiMagnifyingGlass } from 'react-icons/hi2';
|
||||||
import { TypeUser } from '@/module/user';
|
import { funGetAllmember, TypeUser } from '@/module/user';
|
||||||
import { funGetUserByCookies } from '@/module/auth';
|
import { funGetUserByCookies } from '@/module/auth';
|
||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
import { globalMemberDivision } from '../lib/val_division';
|
import { globalMemberDivision } from '../lib/val_division';
|
||||||
@@ -27,16 +27,21 @@ export default function NavbarCreateUsers({ grup, onClose }: { grup?: string, on
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData(search: string) {
|
||||||
const loadMember = await fetch(API_ADDRESS.apiGetAllUser + '&active=true&groupID=' + grup);
|
const res = await funGetAllmember('?active=true&group=' + grup + '&search=' + search);
|
||||||
const user = await funGetUserByCookies();
|
const user = await funGetUserByCookies();
|
||||||
const hasil = await loadMember.json()
|
|
||||||
setDataMember(hasil.filter((i: any) => i.id != user.id))
|
if (res.success) {
|
||||||
|
setDataMember(res.data.filter((i: any) => i.id != user.id))
|
||||||
|
|
||||||
// cek data member sebelumnya
|
// cek data member sebelumnya
|
||||||
if (member.length > 0) {
|
if (member.length > 0) {
|
||||||
setSelectedFiles(JSON.parse(JSON.stringify(member.get())))
|
setSelectedFiles(JSON.parse(JSON.stringify(member.get())))
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
toast.error(res.message)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +54,7 @@ export default function NavbarCreateUsers({ grup, onClose }: { grup?: string, on
|
|||||||
}
|
}
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
loadData()
|
loadData("")
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -69,6 +74,7 @@ export default function NavbarCreateUsers({ grup, onClose }: { grup?: string, on
|
|||||||
radius={30}
|
radius={30}
|
||||||
leftSection={<HiMagnifyingGlass size={20} />}
|
leftSection={<HiMagnifyingGlass size={20} />}
|
||||||
placeholder="Pencarian"
|
placeholder="Pencarian"
|
||||||
|
onChange={(e) => loadData(e.target.value)}
|
||||||
/>
|
/>
|
||||||
<Box pt={10}>
|
<Box pt={10}>
|
||||||
<SimpleGrid
|
<SimpleGrid
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { API_ADDRESS, LayoutDrawer, WARNA } from "@/module/_global";
|
import { LayoutDrawer, WARNA } from "@/module/_global";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { API_ADDRESS, LayoutDrawer, WARNA } from "@/module/_global";
|
import { LayoutDrawer, WARNA } from "@/module/_global";
|
||||||
import LayoutModal from "@/module/_global/layout/layout_modal";
|
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { API_ADDRESS, LayoutDrawer, SkeletonSingle, WARNA } from "@/module/_global";
|
import { LayoutDrawer, SkeletonSingle, WARNA } from "@/module/_global";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Box,
|
Box,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { API_ADDRESS, LayoutDrawer, WARNA } from "@/module/_global"
|
import { LayoutDrawer, WARNA } from "@/module/_global"
|
||||||
import LayoutModal from "@/module/_global/layout/layout_modal"
|
import LayoutModal from "@/module/_global/layout/layout_modal"
|
||||||
import { funGetAllGroup, IDataGroup } from "@/module/group"
|
import { funGetAllGroup, IDataGroup } from "@/module/group"
|
||||||
import { Box, Stack, SimpleGrid, Flex, Text, Select, TextInput, Button } from "@mantine/core"
|
import { Box, Stack, SimpleGrid, Flex, Text, Select, TextInput, Button } from "@mantine/core"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WARNA, LayoutDrawer, API_ADDRESS } from "@/module/_global";
|
import { WARNA, LayoutDrawer } from "@/module/_global";
|
||||||
import { funGetAllGroup, IDataGroup } from "@/module/group";
|
import { funGetAllGroup, IDataGroup } from "@/module/group";
|
||||||
import { Box, Stack, SimpleGrid, Flex, TextInput, Button, Text, Select } from "@mantine/core";
|
import { Box, Stack, SimpleGrid, Flex, TextInput, Button, Text, Select } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { API_ADDRESS, LayoutDrawer, SkeletonSingle, WARNA } from "@/module/_global";
|
import { LayoutDrawer, SkeletonSingle, WARNA } from "@/module/_global";
|
||||||
import { ActionIcon, Box, Group, Text, TextInput } from "@mantine/core";
|
import { ActionIcon, Box, Group, Text, TextInput } from "@mantine/core";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { FaUserTie } from "react-icons/fa6";
|
import { FaUserTie } from "react-icons/fa6";
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ import { apiUser } from "./api/api_user";
|
|||||||
import createLogUser from "./log/fun/createLogUser";
|
import createLogUser from "./log/fun/createLogUser";
|
||||||
import ViewEditProfile from "./profile/view/view_edit_profile";
|
import ViewEditProfile from "./profile/view/view_edit_profile";
|
||||||
import ViewProfile from "./profile/view/view_profile";
|
import ViewProfile from "./profile/view/view_profile";
|
||||||
|
import { funGetAllmember } from './member/lib/api_member';
|
||||||
|
|
||||||
export { ViewProfile };
|
export { ViewProfile };
|
||||||
export { ViewEditProfile };
|
export { ViewEditProfile };
|
||||||
export { apiUser };
|
export { apiUser };
|
||||||
export { createLogUser };
|
export { createLogUser };
|
||||||
export type { TypeUser }
|
export type { TypeUser }
|
||||||
|
export { funGetAllmember }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { API_ADDRESS, WARNA } from "@/module/_global";
|
import { WARNA } from "@/module/_global";
|
||||||
import LayoutModal from "@/module/_global/layout/layout_modal";
|
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||||
import { funGetAllGroup, IDataGroup } from "@/module/group";
|
import { funGetAllGroup, IDataGroup } from "@/module/group";
|
||||||
import { Box, Button, Select, Stack, TextInput } from "@mantine/core";
|
import { Box, Button, Select, Stack, TextInput } from "@mantine/core";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { API_ADDRESS, WARNA } from "@/module/_global";
|
import { WARNA } from "@/module/_global";
|
||||||
import LayoutModal from "@/module/_global/layout/layout_modal";
|
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||||
import { Box, Flex, SimpleGrid, Stack, Text } from "@mantine/core";
|
import { Box, Flex, SimpleGrid, Stack, Text } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { API_ADDRESS, WARNA } from "@/module/_global";
|
import { WARNA } from "@/module/_global";
|
||||||
import LayoutModal from "@/module/_global/layout/layout_modal";
|
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||||
import { funGetAllGroup, IDataGroup } from "@/module/group";
|
import { funGetAllGroup, IDataGroup } from "@/module/group";
|
||||||
import { funGetAllPosition } from "@/module/position/lib/api_position";
|
import { funGetAllPosition } from "@/module/position/lib/api_position";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { LayoutNavbarHome, LayoutIconBack, WARNA, LayoutDrawer, API_ADDRESS } from "@/module/_global";
|
import { LayoutNavbarHome, LayoutIconBack, WARNA, LayoutDrawer } from "@/module/_global";
|
||||||
import { Box, Group, ActionIcon, Stack, Text, Center, Avatar } from "@mantine/core";
|
import { Box, Group, ActionIcon, Stack, Text, Center, Avatar } from "@mantine/core";
|
||||||
import { HiMenu } from "react-icons/hi";
|
import { HiMenu } from "react-icons/hi";
|
||||||
import { HiUser } from "react-icons/hi2";
|
import { HiUser } from "react-icons/hi2";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { API_ADDRESS, WARNA } from "@/module/_global"
|
import { WARNA } from "@/module/_global"
|
||||||
import { Box, Group, ActionIcon, Text, TextInput } from "@mantine/core"
|
import { Box, Group, ActionIcon, Text, TextInput } from "@mantine/core"
|
||||||
import { useShallowEffect } from "@mantine/hooks"
|
import { useShallowEffect } from "@mantine/hooks"
|
||||||
import { useRouter, useSearchParams } from "next/navigation"
|
import { useRouter, useSearchParams } from "next/navigation"
|
||||||
|
|||||||
Reference in New Issue
Block a user