- {/* {JSON.stringify(value, null, 2)} */}
+
- {/*
- minimal partisipan yang akan di pilih untuk mendiskusikan proyek
-
- }
- type="number"
- withAsterisk
- label="Jumlah Partisipan"
- placeholder={"2"}
- value={value.jumlah_partisipan ? value.jumlah_partisipan : ""}
- onChange={(val) => {
- setValue({
- ...value,
- jumlah_partisipan: + val.currentTarget.value
- });
- }}
- /> */}
+
+
+
+ {
+ setValue({
+ ...value,
+ purpose: val,
+ });
+ }}
+ />
+
+
+
+
+
+ {
+ setValue({
+ ...value,
+ benefit: val,
+ });
+ }}
+ />
+
+
+
+
+ {/*
-
+ */}
-
+ {/*
-
+ */}
@@ -211,18 +233,18 @@ function ButtonAction({ value }: { value: any }) {
// if (value.jumlah_partisipan < 2)
// return ComponentGlobal_NotifikasiPeringatan("Minimal Ada 2 Partisipan");
+ setLoading(true);
await colab_funEditById(value as any).then((res) => {
try {
- setLoading(true);
if (res.status === 200) {
router.back();
ComponentGlobal_NotifikasiBerhasil(res.message);
} else {
- setLoading(false)
+ setLoading(false);
ComponentGlobal_NotifikasiGagal(res.message);
}
} catch (error) {
- setLoading(false)
+ setLoading(false);
clientLogger.error("Error update proyek", error);
}
});
@@ -234,11 +256,11 @@ function ButtonAction({ value }: { value: any }) {
disabled={
!value.title ||
!value.lokasi ||
- !value.purpose ||
- !value.benefit ||
- value.projectCollaborationMaster_IndustriId === 0
- ? true
- : false
+ value.projectCollaborationMaster_IndustriId === 0 ||
+ funReplaceHtml({ html: value.purpose }).length > maxInputLength ||
+ funReplaceHtml({ html: value.purpose }).length === 0 ||
+ funReplaceHtml({ html: value.benefit }).length > maxInputLength ||
+ funReplaceHtml({ html: value.benefit }).length === 0
}
loaderPosition="center"
loading={loading ? true : false}
diff --git a/src/app_modules/colab/fun/edit/fun_edit_by_id.ts b/src/app_modules/colab/fun/edit/fun_edit_by_id.ts
index 6a3b4e2e..ce9cf81f 100644
--- a/src/app_modules/colab/fun/edit/fun_edit_by_id.ts
+++ b/src/app_modules/colab/fun/edit/fun_edit_by_id.ts
@@ -6,7 +6,6 @@ import { revalidatePath } from "next/cache";
import { RouterColab } from "@/lib/router_hipmi/router_colab";
export default async function colab_funEditById(value: MODEL_COLLABORATION) {
- console.log(value);
const updt = await prisma.projectCollaboration.update({
where: {
id: value.id,