Merge pull request #223 from bipproduction/amalia/12-september-24
Amalia/12 september 24
This commit is contained in:
@@ -200,6 +200,7 @@ model ProjectFile {
|
||||
idProject String
|
||||
name String
|
||||
extension String
|
||||
idStorage String?
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@ -91,7 +91,8 @@ export async function GET(request: Request, context: { params: { id: string } })
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
extension: true
|
||||
extension: true,
|
||||
idStorage: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { prisma } from "@/module/_global";
|
||||
import { DIR, funDeleteFile, funUploadFile, prisma } from "@/module/_global";
|
||||
import { funGetUserByCookies } from "@/module/auth";
|
||||
import { NextResponse } from "next/server";
|
||||
import fs from "fs";
|
||||
@@ -36,8 +36,7 @@ export async function DELETE(request: Request, context: { params: { id: string }
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
fs.unlink(`./public/file/project/${dataRelasi?.id}.${dataRelasi?.extension}`, (err) => { })
|
||||
const delStorage = await funDeleteFile({ fileId: String(dataRelasi?.idStorage) })
|
||||
|
||||
const deleteRelasi = await prisma.projectFile.delete({
|
||||
where: {
|
||||
@@ -166,31 +165,27 @@ export async function POST(request: Request, context: { params: { id: string } }
|
||||
|
||||
|
||||
if (cekFile) {
|
||||
const root = path.join(process.cwd(), "./public/file/project/");
|
||||
for (var pair of body.entries()) {
|
||||
if (String(pair[0]).substring(0, 4) == "file") {
|
||||
const file = body.get(pair[0]) as File
|
||||
const fExt = file.name.split(".").pop()
|
||||
const fName = file.name.replace("." + fExt, "")
|
||||
|
||||
const upload = await funUploadFile({ file: file, dirId: DIR.project })
|
||||
if (upload.success) {
|
||||
const insertToTable = await prisma.projectFile.create({
|
||||
data: {
|
||||
idStorage: upload.data.id,
|
||||
idProject: id,
|
||||
name: fName,
|
||||
extension: String(fExt),
|
||||
|
||||
const insertToTable = await prisma.projectFile.create({
|
||||
data: {
|
||||
idProject: id,
|
||||
name: fName,
|
||||
extension: String(fExt)
|
||||
},
|
||||
select: {
|
||||
id: true
|
||||
}
|
||||
})
|
||||
|
||||
const nameFix = insertToTable.id + '.' + fExt
|
||||
const filePath = path.join(root, nameFix)
|
||||
// Konversi ArrayBuffer ke Buffer
|
||||
const buffer = Buffer.from(await file.arrayBuffer());
|
||||
// Tulis file ke sistem
|
||||
fs.writeFileSync(filePath, buffer);
|
||||
},
|
||||
select: {
|
||||
id: true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { prisma } from "@/module/_global";
|
||||
import { DIR, funUploadFile, prisma } from "@/module/_global";
|
||||
import { funGetUserByCookies } from "@/module/auth";
|
||||
import _ from "lodash";
|
||||
import moment from "moment";
|
||||
@@ -169,31 +169,22 @@ export async function POST(request: Request) {
|
||||
}
|
||||
|
||||
if (cekFile) {
|
||||
const root = path.join(process.cwd(), "./public/file/project/");
|
||||
for (var pair of body.entries()) {
|
||||
if (String(pair[0]).substring(0, 4) == "file") {
|
||||
const file = body.get(pair[0]) as File
|
||||
const fExt = file.name.split(".").pop()
|
||||
const fName = file.name.replace("." + fExt, "")
|
||||
|
||||
|
||||
const insertToTable = await prisma.projectFile.create({
|
||||
data: {
|
||||
idProject: data.id,
|
||||
name: fName,
|
||||
extension: String(fExt)
|
||||
},
|
||||
select: {
|
||||
id: true
|
||||
}
|
||||
})
|
||||
|
||||
const nameFix = insertToTable.id + '.' + fExt
|
||||
const filePath = path.join(root, nameFix)
|
||||
// Konversi ArrayBuffer ke Buffer
|
||||
const buffer = Buffer.from(await file.arrayBuffer());
|
||||
// Tulis file ke sistem
|
||||
fs.writeFileSync(filePath, buffer);
|
||||
const upload = await funUploadFile({ file: file, dirId: DIR.project })
|
||||
if (upload.success) {
|
||||
await prisma.projectFile.create({
|
||||
data: {
|
||||
idStorage: upload.data.id,
|
||||
idProject: data.id,
|
||||
name: fName,
|
||||
extension: String(fExt)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { prisma } from "@/module/_global";
|
||||
import { DIR, funDeleteFile, funUploadFile, prisma } from "@/module/_global";
|
||||
import { funGetUserByCookies } from "@/module/auth";
|
||||
import { createLogUser } from "@/module/user";
|
||||
import _ from "lodash";
|
||||
import _, { update } from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
@@ -203,22 +203,17 @@ export async function PUT(request: Request, context: { params: { id: string } })
|
||||
});
|
||||
|
||||
if (String(file) != "undefined" && String(file) != "null") {
|
||||
fs.unlink(`./public/image/user/${updates.img}`, (err) => { })
|
||||
const root = path.join(process.cwd(), "./public/image/user/");
|
||||
const fExt = file.name.split(".").pop()
|
||||
const fileName = id + '.' + fExt;
|
||||
const filePath = path.join(root, fileName);
|
||||
|
||||
// Konversi ArrayBuffer ke Buffer
|
||||
const buffer = Buffer.from(await file.arrayBuffer());
|
||||
fs.writeFileSync(filePath, buffer);
|
||||
|
||||
const newFile = new File([file], fileName, { type: file.type });
|
||||
await funDeleteFile({ fileId: String(updates.img) })
|
||||
const upload = await funUploadFile({ file: newFile, dirId: DIR.user })
|
||||
await prisma.user.update({
|
||||
where: {
|
||||
id: id
|
||||
},
|
||||
data: {
|
||||
img: fileName
|
||||
img: upload.data.id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { funDeleteFile, funUploadFile, prisma } from "@/module/_global";
|
||||
import { DIR, funDeleteFile, funUploadFile, prisma } from "@/module/_global";
|
||||
import { funGetUserByCookies } from "@/module/auth";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
@@ -119,34 +119,21 @@ export async function PUT(request: Request) {
|
||||
|
||||
if (String(file) != "undefined" && String(file) != "null") {
|
||||
const fExt = file.name.split(".").pop()
|
||||
// const fileName = user.id + '.' + fExt;
|
||||
const fileName = 'COBAAYAA.' + fExt;
|
||||
const fileName = user.id + '.' + fExt;
|
||||
const newFile = new File([file], fileName, { type: file.type });
|
||||
console.log(fileName, newFile.name)
|
||||
await funDeleteFile({ name: fileName, dirId: "cm0x8dbwn0005bp5tgmfcthzw" })
|
||||
await funUploadFile({ file: newFile, dirId: "cm0x8dbwn0005bp5tgmfcthzw" })
|
||||
await funDeleteFile({ fileId: String(update.img) })
|
||||
const upload = await funUploadFile({ file: newFile, dirId: DIR.user })
|
||||
if (upload.success) {
|
||||
await prisma.user.update({
|
||||
where: {
|
||||
id: user.id
|
||||
},
|
||||
data: {
|
||||
img: upload.data.id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// fs.unlink(`./public/image/user/${update.img}`, (err) => { })
|
||||
// const root = path.join(process.cwd(), "./public/image/user/");
|
||||
// const fExt = file.name.split(".").pop()
|
||||
// const fileName = user.id + '.' + fExt;
|
||||
// const filePath = path.join(root, fileName);
|
||||
|
||||
// // Konversi ArrayBuffer ke Buffer
|
||||
// const buffer = Buffer.from(await file.arrayBuffer());
|
||||
|
||||
// // Tulis file ke sistem
|
||||
// fs.writeFileSync(filePath, buffer);
|
||||
|
||||
// await prisma.user.update({
|
||||
// where: {
|
||||
// id: user.id
|
||||
// },
|
||||
// data: {
|
||||
// img: fileName
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
const log = await createLogUser({ act: 'UPDATE', desc: 'User mengupdate data profile', table: 'user', data: user.id })
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { funUploadFile, prisma } from "@/module/_global";
|
||||
import { DIR, funUploadFile, prisma } from "@/module/_global";
|
||||
import { funGetUserByCookies } from "@/module/auth";
|
||||
import { createLogUser } from "@/module/user";
|
||||
import _ from "lodash";
|
||||
@@ -141,27 +141,17 @@ export async function POST(request: Request) {
|
||||
const fExt = file.name.split(".").pop()
|
||||
const fileName = user.id + '.' + fExt;
|
||||
const newFile = new File([file], fileName, { type: file.type });
|
||||
await funUploadFile({ file: newFile, dirId: "cm0x8dbwn0005bp5tgmfcthzw" })
|
||||
|
||||
// const root = path.join(process.cwd(), "./public/image/user/");
|
||||
// const fExt = file.name.split(".").pop()
|
||||
// const fileName = users.id + '.' + fExt;
|
||||
// const filePath = path.join(root, fileName);
|
||||
|
||||
// // Konversi ArrayBuffer ke Buffer
|
||||
// const buffer = Buffer.from(await file.arrayBuffer());
|
||||
|
||||
// // Tulis file ke sistem
|
||||
// fs.writeFileSync(filePath, buffer);
|
||||
|
||||
// await prisma.user.update({
|
||||
// where: {
|
||||
// id: users.id
|
||||
// },
|
||||
// data: {
|
||||
// img: fileName
|
||||
// }
|
||||
// })
|
||||
const upload = await funUploadFile({ file: newFile, dirId: DIR.user })
|
||||
if (upload.success) {
|
||||
await prisma.user.update({
|
||||
where: {
|
||||
id: users.id
|
||||
},
|
||||
data: {
|
||||
img: upload.data.id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// create log user
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
import { hookstate } from "@hookstate/core"
|
||||
|
||||
export const pwd_key_config = "fchgvjknlmdfnbvghhujlaknsdvjbhknlkmsdbdyu567t8y9u30r4587638y9uipkoeghjvuyi89ipkoefmnrjbhtiu4or9ipkoemnjfbhjiuoijdklnjhbviufojkejnshbiuojijknehgruyu"
|
||||
export const globalRole = hookstate<string>('')
|
||||
export const globalRole = hookstate<string>('')
|
||||
export const DIR = {
|
||||
task: "cm0xhcqf0000dacbbixjb09yn",
|
||||
project: "cm0xhc9sv000bacbb7rfikw1k",
|
||||
document: "cm0xhbkf50009acbbtw03qo4l",
|
||||
village: "cm0xhb91o0007acbbkx8rk8hj",
|
||||
user: "cm0x8dbwn0005bp5tgmfcthzw",
|
||||
|
||||
}
|
||||
@@ -1,22 +1,21 @@
|
||||
export async function funDeleteFile({ name, dirId }: { name: String, dirId: string }) {
|
||||
export async function funDeleteFile({ fileId }: { fileId: string }) {
|
||||
try {
|
||||
const res = await fetch(`https://wibu-storage.wibudev.com/api/dir/${dirId}/${name}`, {
|
||||
method: "GET",
|
||||
const res = await fetch(`https://wibu-storage.wibudev.com/api/files/${fileId}/delete`, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
Authorization: `Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7ImlkIjoiY20wdnQ4bzFrMDAwMDEyenE1eXl1emd5YiIsIm5hbWUiOiJhbWFsaWEiLCJlbWFpbCI6ImFtYWxpYUBiaXAuY29tIiwiQXBpS2V5IjpbeyJpZCI6ImNtMHZ0OG8xcjAwMDIxMnpxZDVzejd3eTgiLCJuYW1lIjoiZGVmYXVsdCJ9XX0sImlhdCI6MTcyNTkzNTE5MiwiZXhwIjo0ODgxNjk1MTkyfQ.7U-HUnNBDmeq_6XXohiFZjFnh2rSzUPMHDdrUKOd7G4`
|
||||
Authorization: `Bearer ${process.env.WS_APIKEY}`
|
||||
}
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
console.log("Berhasil dapat");
|
||||
const hasil = await res.json()
|
||||
console.log('berhasilAmalia', hasil)
|
||||
|
||||
return { success: true }
|
||||
} else {
|
||||
const errorText = await res.json();
|
||||
console.log('errorAmalia', errorText)
|
||||
return { success: false }
|
||||
}
|
||||
} catch (error) {
|
||||
return { success: false }
|
||||
console.error("Upload error:", error);
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,14 @@ export async function funUploadFile({ file, dirId }: { file: File, dirId: string
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
console.log("File uploaded successfully");
|
||||
const hasil = await res.json()
|
||||
return { success: true, data: hasil.data }
|
||||
} else {
|
||||
const errorText = await res.text();
|
||||
console.log('errorAmalia', errorText)
|
||||
return { success: false, data: {} }
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Upload error:", error);
|
||||
return { success: false, data: {} }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import prisma from "./bin/prisma";
|
||||
import { globalRole, pwd_key_config } from "./bin/val_global";
|
||||
import { DIR, globalRole, pwd_key_config } from "./bin/val_global";
|
||||
import SkeletonDetailDiscussionComment from "./components/skeleton_detail_discussion_comment";
|
||||
import SkeletonDetailDiscussionMember from "./components/skeleton_detail_discussion_member";
|
||||
import SkeletonDetailListTugasTask from "./components/skeleton_detail_list_tugas_task";
|
||||
@@ -40,3 +40,4 @@ export { WrapLayout }
|
||||
export { NoZoom }
|
||||
export { funUploadFile }
|
||||
export { funDeleteFile }
|
||||
export { DIR }
|
||||
|
||||
@@ -55,7 +55,7 @@ export default function LayoutModal({ opened, onClose, extension, fitur, file }:
|
||||
}}>
|
||||
<div style={{ transform: `scale(${zoom})`, transformOrigin: 'center' }}>
|
||||
{
|
||||
extension === 'pdf' ? <PdfToImage md={filePdf} /> :
|
||||
extension === 'pdf' ? <PdfToImage md={`https://wibu-storage.wibudev.com/api/files/${file}`} /> :
|
||||
<Image
|
||||
radius="md"
|
||||
style={{
|
||||
@@ -63,7 +63,7 @@ export default function LayoutModal({ opened, onClose, extension, fitur, file }:
|
||||
maxHeight: '100%',
|
||||
}}
|
||||
fit="contain"
|
||||
src={`/api/file/img?cat=${fitur}&file=${file}&jenis=file`}
|
||||
src={`https://wibu-storage.wibudev.com/api/files/${file}`}
|
||||
alt={file}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ export default function CreateUserCalender({ onClose }: { onClose: (val: any) =>
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -226,7 +226,7 @@ export default function CreateUserCalender({ onClose }: { onClose: (val: any) =>
|
||||
xl: "xs"
|
||||
}}>
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<Flex justify='space-between' align={"center"}>
|
||||
|
||||
@@ -195,7 +195,7 @@ export default function CreateUserDetailCalender() {
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -240,7 +240,7 @@ export default function CreateUserDetailCalender() {
|
||||
xl: "xs"
|
||||
}}>
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<Flex justify='space-between' align={"center"}>
|
||||
|
||||
@@ -273,7 +273,7 @@ export default function DetailEventDivision() {
|
||||
base: 3,
|
||||
xl: 2
|
||||
}}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={{
|
||||
base: 9,
|
||||
|
||||
@@ -300,7 +300,7 @@ export default function NavbarCreateDivisionCalender() {
|
||||
>
|
||||
<Grid.Col span={9}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
<Box w={{
|
||||
base: 140,
|
||||
xl: 270
|
||||
|
||||
@@ -183,7 +183,7 @@ export default function UpdateListUsers({ onClose }: { onClose: (val: any) => vo
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -227,7 +227,7 @@ export default function UpdateListUsers({ onClose }: { onClose: (val: any) => vo
|
||||
xl: "xs"
|
||||
}}>
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<Flex justify='space-between' align={"center"}>
|
||||
|
||||
@@ -131,7 +131,7 @@ export default function DetailDiscussion({ id, idDivision }: { id: string, idDiv
|
||||
>
|
||||
{isData?.username ?
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${isData?.user_img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${isData?.user_img}`} alt="it's me" size="lg" />
|
||||
<Box>
|
||||
<Text c={WARNA.biruTua} fw={"bold"}>
|
||||
{isData?.username}
|
||||
@@ -165,7 +165,7 @@ export default function DetailDiscussion({ id, idDivision }: { id: string, idDiv
|
||||
<Box mb={20}>
|
||||
<Grid align="center">
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${isData?.user_img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${isData?.user_img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Box pl={{
|
||||
@@ -245,7 +245,7 @@ export default function DetailDiscussion({ id, idDivision }: { id: string, idDiv
|
||||
<Box key={i} p={10} >
|
||||
<Grid align="center">
|
||||
<Grid.Col span={2}>
|
||||
<Avatar alt="it's me" size="md" src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} />
|
||||
<Avatar alt="it's me" size="md" src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Box>
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function FormCreateDiscussion({ id }: { id: string }) {
|
||||
try {
|
||||
setLoading(true)
|
||||
const res = await funGetProfileByCookies()
|
||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
||||
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
@@ -61,7 +61,7 @@ export default function FormEditDiscussion() {
|
||||
try {
|
||||
setLoading(true)
|
||||
const res = await funGetProfileByCookies()
|
||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
||||
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
@@ -105,7 +105,7 @@ export default function ListDiscussion({ id }: { id: string }) {
|
||||
router.push(`/division/${param.id}/discussion/${v.id}`)
|
||||
}}>
|
||||
<Grid.Col span={2}>
|
||||
<Avatar alt="it's me" src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} size="lg" />
|
||||
<Avatar alt="it's me" src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Box pl={{
|
||||
|
||||
@@ -160,7 +160,7 @@ export default function CreateAnggotaDivision() {
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -195,7 +195,7 @@ export default function CreateAnggotaDivision() {
|
||||
<Box my={10} key={index} onClick={() => (!found) ? handleFileClick(index) : null}>
|
||||
<Grid align='center' >
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<Flex justify='space-between' align={"center"}>
|
||||
|
||||
@@ -195,7 +195,7 @@ export default function CreateDivision() {
|
||||
>
|
||||
<Grid.Col span={9}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Box w={{
|
||||
base: isMobile ? 130 : 140,
|
||||
xl: 270
|
||||
|
||||
@@ -208,7 +208,7 @@ export default function InformationDivision() {
|
||||
>
|
||||
<Grid.Col span={9}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Box w={{
|
||||
base: isMobile ? 130 : 140,
|
||||
xl: 270
|
||||
|
||||
@@ -72,7 +72,7 @@ export default function NavbarAdminDivision({ data, onSuccess }: { data: any, on
|
||||
>
|
||||
<Grid.Col span={10}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
<Box w={{
|
||||
base: 200,
|
||||
xl: 270
|
||||
|
||||
@@ -147,7 +147,7 @@ export default function NavbarCreateUsers({ grup, onClose }: { grup?: string, on
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -184,7 +184,7 @@ export default function NavbarCreateUsers({ grup, onClose }: { grup?: string, on
|
||||
base: 3,
|
||||
xl: 2
|
||||
}}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={{
|
||||
base: 9,
|
||||
|
||||
@@ -86,7 +86,7 @@ export default function ViewSearch() {
|
||||
xl: "xs"
|
||||
}} align="center">
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} size={50} alt="image" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} size={50} alt="image" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={9}>
|
||||
<Text fw={'bold'} c={WARNA.biruTua} lineClamp={1}>{_.startCase(v.name)}</Text>
|
||||
|
||||
@@ -19,6 +19,7 @@ export interface IDataFileProject {
|
||||
id: string
|
||||
name: string
|
||||
extension: string
|
||||
idStorage:string
|
||||
}
|
||||
|
||||
export interface IDataMemberProject {
|
||||
|
||||
@@ -188,7 +188,7 @@ export default function AddMemberDetailProject() {
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -233,7 +233,7 @@ export default function AddMemberDetailProject() {
|
||||
base: 3,
|
||||
xl: 2
|
||||
}}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={{
|
||||
base: 9,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
import { LayoutNavbarNew, WARNA } from "@/module/_global";
|
||||
import {
|
||||
ActionIcon,
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
@@ -19,9 +20,10 @@ import { useRouter } from "next/navigation";
|
||||
import toast from "react-hot-toast";
|
||||
import moment from "moment";
|
||||
import { IFormDateProject } from "../lib/type_project";
|
||||
import { HiChevronLeft } from "react-icons/hi2";
|
||||
|
||||
|
||||
export default function ViewDateEndTask({ onClose }: { onClose: (val: IFormDateProject) => void }) {
|
||||
export default function ViewDateEndTask({ onClose, onSet }: {onClose: (val: boolean) => void, onSet: (val: IFormDateProject) => void }) {
|
||||
const [value, setValue] = useState<[Date | null, Date | null]>([null, null]);
|
||||
const router = useRouter()
|
||||
const [title, setTitle] = useState("")
|
||||
@@ -36,7 +38,7 @@ export default function ViewDateEndTask({ onClose }: { onClose: (val: IFormDateP
|
||||
if (title == "")
|
||||
return toast.error("Error! harus memasukkan judul tugas")
|
||||
|
||||
onClose(
|
||||
onSet(
|
||||
{
|
||||
dateStart: value[0],
|
||||
dateEnd: value[1],
|
||||
@@ -48,7 +50,13 @@ export default function ViewDateEndTask({ onClose }: { onClose: (val: IFormDateP
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<LayoutNavbarNew title={"Tanggal Tugas"} menu />
|
||||
<LayoutNavbarNew state={
|
||||
<Box>
|
||||
<ActionIcon variant="light" onClick={() => { onClose(true) }} bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||
<HiChevronLeft size={20} color='white' />
|
||||
</ActionIcon>
|
||||
</Box>
|
||||
} title={"Tanggal Tugas"} menu />
|
||||
<Box p={20}>
|
||||
<Group
|
||||
justify="center"
|
||||
|
||||
@@ -128,10 +128,7 @@ export default function CreateProject() {
|
||||
|
||||
|
||||
|
||||
if (openTugas) return <ViewDateEndTask onClose={(val) => {
|
||||
setDataTask([...dataTask, val])
|
||||
setOpenTugas(false)
|
||||
}} />;
|
||||
if (openTugas) return <ViewDateEndTask onClose={(val) => { setOpenTugas(false) }} onSet={(val) => { setDataTask([...dataTask, val]); setOpenTugas(false) }} />;
|
||||
|
||||
if (isChooseAnggota) return <CreateUsersProject grup={body.idGroup} onClose={() => { setChooseAnggota(false) }} />
|
||||
|
||||
@@ -303,7 +300,7 @@ export default function CreateProject() {
|
||||
>
|
||||
<Grid.Col span={9}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Box w={{
|
||||
base: isMobile ? 130 : 140,
|
||||
xl: 270
|
||||
|
||||
@@ -149,7 +149,7 @@ export default function CreateUsersProject({ grup, onClose }: { grup?: string, o
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -187,7 +187,7 @@ export default function CreateUsersProject({ grup, onClose }: { grup?: string, o
|
||||
base: 3,
|
||||
xl: 2
|
||||
}}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={{
|
||||
base: 9,
|
||||
|
||||
@@ -102,7 +102,7 @@ const isMobile = useMediaQuery('(max-width: 369px)');
|
||||
>
|
||||
<Grid.Col span={9}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Box w={{
|
||||
base: isMobile ? 130 : 140,
|
||||
xl: 270
|
||||
|
||||
@@ -16,6 +16,7 @@ export default function ListFileDetailProject() {
|
||||
const param = useParams<{ id: string }>()
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [idData, setIdData] = useState('')
|
||||
const [idStorage, setIdStorage] = useState('')
|
||||
const [nameData, setNameData] = useState('')
|
||||
const [openDrawer, setOpenDrawer] = useState(false)
|
||||
const [isOpenModal, setOpenModal] = useState(false)
|
||||
@@ -52,6 +53,7 @@ export default function ListFileDetailProject() {
|
||||
toast.success(res.message)
|
||||
getOneData()
|
||||
setIdData("")
|
||||
setIdStorage("")
|
||||
setOpenDrawer(false)
|
||||
} else {
|
||||
toast.error(res.message);
|
||||
@@ -102,6 +104,7 @@ export default function ListFileDetailProject() {
|
||||
setNameData(item.name + '.' + item.extension)
|
||||
setExtension(item.extension)
|
||||
setIdData(item.id)
|
||||
setIdStorage(item.idStorage)
|
||||
setOpenDrawer(true)
|
||||
}}
|
||||
>
|
||||
@@ -167,7 +170,7 @@ export default function ListFileDetailProject() {
|
||||
setOpenModal(false)
|
||||
}} />
|
||||
|
||||
<LayoutModalViewFile opened={isOpenModalView} onClose={() => setOpenModalView(false)} file={idData + '.' + isExtension} extension={isExtension} fitur='project' />
|
||||
<LayoutModalViewFile opened={isOpenModalView} onClose={() => setOpenModalView(false)} file={idStorage} extension={isExtension} fitur='project' />
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -223,7 +223,7 @@ export default function AddMemberDetailTask() {
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -268,7 +268,7 @@ export default function AddMemberDetailTask() {
|
||||
base: 3,
|
||||
xl: 2
|
||||
}}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={{
|
||||
base: 9,
|
||||
|
||||
@@ -237,7 +237,7 @@ export default function CreateTask() {
|
||||
>
|
||||
<Grid.Col span={9}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Box w={{
|
||||
base: isMobile ? 130 : 140,
|
||||
xl: 270
|
||||
|
||||
@@ -199,7 +199,7 @@ export default function CreateUsersProject({ onClose }: { onClose: (val: any) =>
|
||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||
<Avatar style={{
|
||||
border: `2px solid ${WARNA.biruTua}`
|
||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Indicator>
|
||||
</Center>
|
||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||
@@ -248,7 +248,7 @@ export default function CreateUsersProject({ onClose }: { onClose: (val: any) =>
|
||||
base: 3,
|
||||
xl: 2
|
||||
}}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={{
|
||||
base: 9,
|
||||
|
||||
@@ -105,7 +105,7 @@ export default function ListAnggotaDetailTask() {
|
||||
>
|
||||
<Grid.Col span={9}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||
<Box w={{
|
||||
base: isMobile ? 130 : 140,
|
||||
xl: 270
|
||||
|
||||
@@ -442,7 +442,7 @@ export default function CreateMember() {
|
||||
onBlur={() => setTouched({ ...touched, gender: true })}
|
||||
error={
|
||||
touched.gender && (
|
||||
listData.gender == "" ? "Gender Tidak Boleh Kosong" : null
|
||||
listData.gender == "" ? "Jenis Kelamin Tidak Boleh Kosong" : null
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -71,7 +71,7 @@ export default function EditMember({ id }: { id: string }) {
|
||||
const res = await funGetOneMember(id)
|
||||
setData(res.data)
|
||||
getAllPosition(res.data?.idGroup)
|
||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
||||
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -72,7 +72,7 @@ export default function NavbarDetailMember({ id }: IMember) {
|
||||
gap="xs"
|
||||
>
|
||||
<Center>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${dataOne?.img}`} alt="it's me" size="xl" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${dataOne?.img}`} alt="it's me" size="xl" />
|
||||
</Center>
|
||||
{loading ?
|
||||
<>
|
||||
|
||||
@@ -92,7 +92,7 @@ export default function TabListMember() {
|
||||
xl: "xs"
|
||||
}} align="center">
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} size={50} alt="image" />
|
||||
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} size={50} alt="image" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={9}>
|
||||
<Text fw={'bold'} c={WARNA.biruTua} lineClamp={1}>{_.startCase(v.name)}</Text>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
export async function getListDir() {
|
||||
try {
|
||||
const res = await fetch("https://wibu-storage.wibudev.com/api/dir/cm0x8a1as0001bp5te7354yrp/list", {
|
||||
method: "GET",
|
||||
headers: {
|
||||
Authorization: `Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7ImlkIjoiY20wdnQ4bzFrMDAwMDEyenE1eXl1emd5YiIsIm5hbWUiOiJhbWFsaWEiLCJlbWFpbCI6ImFtYWxpYUBiaXAuY29tIiwiQXBpS2V5IjpbeyJpZCI6ImNtMHZ0OG8xcjAwMDIxMnpxZDVzejd3eTgiLCJuYW1lIjoiZGVmYXVsdCJ9XX0sImlhdCI6MTcyNTkzNTE5MiwiZXhwIjo0ODgxNjk1MTkyfQ.7U-HUnNBDmeq_6XXohiFZjFnh2rSzUPMHDdrUKOd7G4`
|
||||
}
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
const hasil = await res.json()
|
||||
console.log("File uploaded successfully");
|
||||
console.log(hasil)
|
||||
} else {
|
||||
const errorText = await res.text();
|
||||
console.log(errorText)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Upload error:", error);
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ export default function EditProfile() {
|
||||
setLoading(true)
|
||||
const res = await funGetProfileByCookies()
|
||||
setData(res.data)
|
||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
||||
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -258,31 +258,31 @@ export default function EditProfile() {
|
||||
zIndex: 999,
|
||||
backgroundColor: `${WARNA.bgWhite}`,
|
||||
}}>
|
||||
{loading ?
|
||||
<Skeleton height={50} radius={30} />
|
||||
{loading ?
|
||||
<Skeleton height={50} radius={30} />
|
||||
:
|
||||
<Button
|
||||
c={"white"}
|
||||
bg={WARNA.biruTua}
|
||||
size="md"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => {
|
||||
if (
|
||||
data.nik !== "" &&
|
||||
data.name !== "" &&
|
||||
data.email !== "" &&
|
||||
data.phone !== "" &&
|
||||
data.gender !== ""
|
||||
) {
|
||||
setValModal(true)
|
||||
} else {
|
||||
toast.error("Mohon lengkapi semua form");
|
||||
}
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
<Button
|
||||
c={"white"}
|
||||
bg={WARNA.biruTua}
|
||||
size="md"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => {
|
||||
if (
|
||||
data.nik !== "" &&
|
||||
data.name !== "" &&
|
||||
data.email !== "" &&
|
||||
data.phone !== "" &&
|
||||
data.gender !== ""
|
||||
) {
|
||||
setValModal(true)
|
||||
} else {
|
||||
toast.error("Mohon lengkapi semua form");
|
||||
}
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
}
|
||||
</Box>
|
||||
<LayoutModal opened={isValModal} onClose={() => setValModal(false)}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"use client"
|
||||
import { LayoutIconBack, LayoutNavbarHome, SkeletonDetailProfile, WARNA } from "@/module/_global";
|
||||
import { ActionIcon, Anchor, Avatar, Box, Button, Flex, Grid, Group, SimpleGrid, Skeleton, Stack, Text } from "@mantine/core";
|
||||
import { HiUser } from "react-icons/hi2";
|
||||
import { ActionIcon, Avatar, Box, Grid, Group, Skeleton, Stack, Text } from "@mantine/core";
|
||||
import { RiIdCardFill } from "react-icons/ri";
|
||||
import { FaSquarePhone } from "react-icons/fa6";
|
||||
import { MdEmail } from "react-icons/md";
|
||||
@@ -27,8 +26,7 @@ export default function Profile() {
|
||||
setLoading(true)
|
||||
const res = await funGetProfileByCookies()
|
||||
setData(res.data)
|
||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
||||
// setIMG(`https://wibu-storage.wibudev.com/api/files/view/cm0x8dbwn0005bp5tgmfcthzw/${res.data.img}`)
|
||||
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
Reference in New Issue
Block a user