fix
Deskripsi: - Upload ke stroage untuk job ## Np Issuee
This commit is contained in:
@@ -28,7 +28,7 @@ export default function Admin_Logout() {
|
||||
const [loadingLogout, setLoadingLogout] = useState(false);
|
||||
|
||||
async function onClickLogout() {
|
||||
await auth_Logout(kodeId).then((res) => {
|
||||
await auth_Logout().then((res) => {
|
||||
if (res.status === 200) {
|
||||
setLoadingLogout(true);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { RouterAdminColab } from "@/app/lib/router_admin/router_admin_colab";
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function adminColab_funReportProjectById({
|
||||
colabId,
|
||||
@@ -14,11 +12,7 @@ export default async function adminColab_funReportProjectById({
|
||||
colabId: string;
|
||||
report: string;
|
||||
}) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
if (!authorId) {
|
||||
redirect(RouterAuth.login);
|
||||
// return { status: 400, message: "Gagal mendapatkan authorId" };
|
||||
}
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
const projectUpdate = await prisma.projectCollaboration.update({
|
||||
where: {
|
||||
@@ -39,7 +33,7 @@ export default async function adminColab_funReportProjectById({
|
||||
const updateReport = await prisma.projectCollaboration_Notifikasi.create({
|
||||
data: {
|
||||
projectCollaborationId: colabId,
|
||||
adminId: authorId,
|
||||
adminId: userLoginId,
|
||||
userId: projectUpdate.userId as any,
|
||||
note: "Project Anda Telah Direport Admin",
|
||||
},
|
||||
|
||||
@@ -353,6 +353,11 @@ async function onPublish({
|
||||
"USER",
|
||||
JSON.stringify({ userId: publish?.data?.authorId, count: 1 })
|
||||
);
|
||||
|
||||
mqtt_client.publish(
|
||||
"Job_new_post",
|
||||
JSON.stringify({ isNewPost: true, count: 1 })
|
||||
);
|
||||
}
|
||||
|
||||
ComponentGlobal_NotifikasiBerhasil(publish.message);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
|
||||
export default async function adminNotifikasi_countNotifikasi() {
|
||||
const adminId = await user_funGetOneUserId();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
const data = await prisma.notifikasi.findMany({
|
||||
where: {
|
||||
adminId: adminId,
|
||||
adminId: userLoginId,
|
||||
isRead: false,
|
||||
userRoleId: "2",
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||
|
||||
export default async function adminNotifikasi_funCreateToUser({
|
||||
@@ -9,11 +9,11 @@ export default async function adminNotifikasi_funCreateToUser({
|
||||
}: {
|
||||
data: MODEL_NOTIFIKASI;
|
||||
}) {
|
||||
const adminId = await user_funGetOneUserId();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
const create = await prisma.notifikasi.create({
|
||||
data: {
|
||||
adminId: adminId,
|
||||
adminId: userLoginId,
|
||||
userId: data.userId,
|
||||
appId: data.appId,
|
||||
status: data.status,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { NextRequest } from "next/server";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
|
||||
export default async function adminNotifikasi_getByUserId() {
|
||||
const adminId = await user_funGetOneUserId();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
const data = await prisma.notifikasi.findMany({
|
||||
orderBy: [
|
||||
@@ -17,7 +16,7 @@ export default async function adminNotifikasi_getByUserId() {
|
||||
},
|
||||
],
|
||||
where: {
|
||||
adminId: adminId,
|
||||
adminId: userLoginId,
|
||||
userRoleId: "2",
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user