@@ -5,16 +5,6 @@
|
|||||||
},
|
},
|
||||||
"auditLog": "logs/backend/.31d2357fa2026a78b8cb786880c7c733460d7dbe-audit.json",
|
"auditLog": "logs/backend/.31d2357fa2026a78b8cb786880c7c733460d7dbe-audit.json",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
|
||||||
"date": 1737425815219,
|
|
||||||
"name": "logs/backend/combined-2025-01-21.log",
|
|
||||||
"hash": "b9cbc8d149568aaeb134725613e3cbf7e862bfe2acb7e6db56292abbf79e51a1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"date": 1737497241982,
|
|
||||||
"name": "logs/backend/combined-2025-01-22.log",
|
|
||||||
"hash": "574f8bfec27f059626b3174fe1911a733e84d38ac91be87f853456aae15b11a7"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"date": 1737685849478,
|
"date": 1737685849478,
|
||||||
"name": "logs/backend/combined-2025-01-24.log",
|
"name": "logs/backend/combined-2025-01-24.log",
|
||||||
@@ -54,6 +44,16 @@
|
|||||||
"date": 1738549408639,
|
"date": 1738549408639,
|
||||||
"name": "logs/backend/combined-2025-02-03.log",
|
"name": "logs/backend/combined-2025-02-03.log",
|
||||||
"hash": "f3f6220a7d5836dbdd5893576479feee4d13abcdfe1ee2e89375e18abea72ee5"
|
"hash": "f3f6220a7d5836dbdd5893576479feee4d13abcdfe1ee2e89375e18abea72ee5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1738635038169,
|
||||||
|
"name": "logs/backend/combined-2025-02-04.log",
|
||||||
|
"hash": "b197eb2d58bbab3566e05fdb2bcc52ee608c4fe6ffb54fc958060c8dc4ff305f"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1738709515069,
|
||||||
|
"name": "logs/backend/combined-2025-02-05.log",
|
||||||
|
"hash": "04d27d0d5708dfb4655dbb708eb49f663c063c8f571ea5aa4da9e5bee9daa0f3"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hashType": "sha256"
|
"hashType": "sha256"
|
||||||
|
|||||||
@@ -5,16 +5,6 @@
|
|||||||
},
|
},
|
||||||
"auditLog": "logs/backend/.5d9a990e0c6075347623def466341a14f8ba4a12-audit.json",
|
"auditLog": "logs/backend/.5d9a990e0c6075347623def466341a14f8ba4a12-audit.json",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
|
||||||
"date": 1737425815214,
|
|
||||||
"name": "logs/backend/error-2025-01-21.log",
|
|
||||||
"hash": "d35389a53138894117f18cdd8210378c4ccfeea9921a52e42837102cad72c108"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"date": 1737497241981,
|
|
||||||
"name": "logs/backend/error-2025-01-22.log",
|
|
||||||
"hash": "cb0bde065d94357687bece5102573a1876e3f00e1513ff9189e07f56cdadb82e"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"date": 1737685849475,
|
"date": 1737685849475,
|
||||||
"name": "logs/backend/error-2025-01-24.log",
|
"name": "logs/backend/error-2025-01-24.log",
|
||||||
@@ -54,6 +44,16 @@
|
|||||||
"date": 1738549408637,
|
"date": 1738549408637,
|
||||||
"name": "logs/backend/error-2025-02-03.log",
|
"name": "logs/backend/error-2025-02-03.log",
|
||||||
"hash": "ffd13b033c90d60d10c935a41fe42f3a4d065311cbf7beda1b76b9c5c985e90b"
|
"hash": "ffd13b033c90d60d10c935a41fe42f3a4d065311cbf7beda1b76b9c5c985e90b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1738635038164,
|
||||||
|
"name": "logs/backend/error-2025-02-04.log",
|
||||||
|
"hash": "7490b9f6c36fa2500bafa66c4aa590053c50234150ad9ad86ad9400f0ba76a43"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1738709515065,
|
||||||
|
"name": "logs/backend/error-2025-02-05.log",
|
||||||
|
"hash": "b76580b2a8b76ee8941e0d913ff1b38d66ad7bd45f154ed371c913ff898e5dfd"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hashType": "sha256"
|
"hashType": "sha256"
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
{"level":"info","message":"Server status code: 201","timestamp":"2025-01-21T05:44:04.245Z"}
|
|
||||||
{"level":"info","message":"Success upload donasi_bukti_transfer: {\"id\":\"cm661vcrb002a7r93gbyi7y0g\",\"name\":\"56FE8EB6-BB7C-45BF-8879-A3EB7C59CA58.PNG\",\"path\":\"/cm0ur1yxw000056nsjlr6187p/2025/01/21/56FE8EB6-BB7C-45BF-8879-A3EB7C59CA58.PNG\",\"mime\":\"image/png\",\"ext\":\".PNG\",\"desc\":null,\"size\":2531618,\"active\":true,\"createdAt\":\"2025-01-21T05:44:03.670Z\",\"updatedAt\":\"2025-01-21T05:44:03.671Z\",\"userId\":\"cm0ur1yxw000056nsjlr6187p\",\"dirId\":\"cm0yk1pmh000h10njhi6m8b8t\"}","timestamp":"2025-01-21T05:44:04.331Z"}
|
|
||||||
{"level":"info","message":"Server status code: 201","timestamp":"2025-01-21T05:53:55.644Z"}
|
|
||||||
{"level":"info","message":"Success upload event_sponsor: {\"id\":\"cm66281fn001rc9dcdf7m74ji\",\"name\":\"56FE8EB6-BB7C-45BF-8879-A3EB7C59CA58-1.PNG\",\"path\":\"/cm0ur1yxw000056nsjlr6187p/2025/01/21/56FE8EB6-BB7C-45BF-8879-A3EB7C59CA58-1.PNG\",\"mime\":\"image/png\",\"ext\":\".PNG\",\"desc\":null,\"size\":2531618,\"active\":true,\"createdAt\":\"2025-01-21T05:53:55.522Z\",\"updatedAt\":\"2025-01-21T05:53:55.523Z\",\"userId\":\"cm0ur1yxw000056nsjlr6187p\",\"dirId\":\"cm65zlbyf001udvmggnd6i0oh\"}","timestamp":"2025-01-21T05:53:55.647Z"}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","originalColumn":16,"originalLine":1069,"stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at new eS (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:26724)\n at e_ (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27574)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32507)\n at get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32603)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1217)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1084)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39714)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:33303)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36)\n at run (node:async_hooks:64:22)","timestamp":"2025-01-21T22:11:48.296Z"}
|
|
||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","originalColumn":16,"originalLine":1069,"stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at new eS (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:26724)\n at e_ (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27574)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32507)\n at get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32603)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1217)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1084)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39714)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:33303)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36)\n at run (node:async_hooks:64:22)","timestamp":"2025-01-21T22:24:18.884Z"}
|
|
||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","originalColumn":16,"originalLine":1069,"stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at new eS (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:26724)\n at e_ (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27574)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32507)\n at get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32603)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1217)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1084)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39714)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:33303)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36)\n at run (node:async_hooks:64:22)","timestamp":"2025-01-21T22:31:50.770Z"}
|
|
||||||
@@ -5,3 +5,4 @@
|
|||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at new eS (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:26724)\n at e_ (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27574)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32507)\n at get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32603)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39714)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:33303)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36)\n at run (node:async_hooks:64:22)","timestamp":"2025-02-03T06:56:34.648Z"}
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at new eS (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:26724)\n at e_ (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27574)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32507)\n at get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32603)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39714)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:33303)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36)\n at run (node:async_hooks:64:22)","timestamp":"2025-02-03T06:56:34.648Z"}
|
||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-03T07:06:48.864Z"}
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-03T07:06:48.864Z"}
|
||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-03T07:32:02.910Z"}
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-03T07:32:02.910Z"}
|
||||||
|
{"id":"f6b224a2-3aeb-4cbc-afee-075a7965ab70","level":"info","message":"Success send message","status":"success","timestamp":"2025-02-03T09:53:34.492Z"}
|
||||||
|
|||||||
2
logs/backend/combined-2025-02-04.log
Normal file
2
logs/backend/combined-2025-02-04.log
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-04T03:16:37.809Z"}
|
||||||
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-04T06:54:35.085Z"}
|
||||||
1
logs/backend/combined-2025-02-05.log
Normal file
1
logs/backend/combined-2025-02-05.log
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-05T02:30:14.963Z"}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","originalColumn":16,"originalLine":1069,"stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at new eS (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:26724)\n at e_ (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27574)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32507)\n at get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32603)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1217)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1084)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39714)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:33303)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36)\n at run (node:async_hooks:64:22)","timestamp":"2025-01-21T22:11:48.296Z"}
|
|
||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","originalColumn":16,"originalLine":1069,"stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at new eS (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:26724)\n at e_ (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27574)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32507)\n at get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32603)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1217)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1084)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39714)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:33303)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36)\n at run (node:async_hooks:64:22)","timestamp":"2025-01-21T22:24:18.884Z"}
|
|
||||||
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","originalColumn":16,"originalLine":1069,"stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at new eS (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:26724)\n at e_ (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27574)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32507)\n at get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32603)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1217)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1084)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39714)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:33303)\n at <anonymous> (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36)\n at run (node:async_hooks:64:22)","timestamp":"2025-01-21T22:31:50.770Z"}
|
|
||||||
2
logs/backend/error-2025-02-04.log
Normal file
2
logs/backend/error-2025-02-04.log
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-04T03:16:37.809Z"}
|
||||||
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-04T06:54:35.085Z"}
|
||||||
1
logs/backend/error-2025-02-05.log
Normal file
1
logs/backend/error-2025-02-05.log
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"digest":"DYNAMIC_SERVER_USAGE","level":"error","message":"Error get data detail event: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error","stack":"Error: Dynamic server usage: Page couldn't be rendered statically because it used `request.url`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error\n at Object.e_ [as staticGenerationBailout] (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:27571)\n at i (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32508)\n at Object.get (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:32604)\n at GET (/Users/bagasbanuna/Documents/BIP/hipmi/.next/server/app/api/event/check-peserta/route.js:1:1219)\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:14:39715\n at /Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/server/lib/trace/tracer.js:121:36\n at NoopContextManager.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)\n at ContextAPI.with (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)\n at NoopTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)\n at ProxyTracer.startActiveSpan (/Users/bagasbanuna/Documents/BIP/hipmi/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)","timestamp":"2025-02-05T02:30:14.963Z"}
|
||||||
30
src/app/api/auth/check/[id]/route.ts
Normal file
30
src/app/api/auth/check/[id]/route.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { prisma } from "@/app/lib";
|
||||||
|
import backendLogger from "@/util/backendLogger";
|
||||||
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
|
export async function GET(
|
||||||
|
request: Request,
|
||||||
|
{ params }: { params: { id: string } }
|
||||||
|
) {
|
||||||
|
if (request.method !== "GET") {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Method not allowed" },
|
||||||
|
{ status: 405 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { id } = params;
|
||||||
|
const data = await prisma.kodeOtp.findFirst({
|
||||||
|
where: {
|
||||||
|
id: id as string,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(data, { status: 200 });
|
||||||
|
} catch (error) {
|
||||||
|
backendLogger.error("Error get code otp", error); //(error);
|
||||||
|
return NextResponse.json(null, { status: 500 });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { prisma } from "@/app/lib";
|
|
||||||
import { data } from "autoprefixer";
|
|
||||||
import { NextRequest, NextResponse } from "next/server";
|
|
||||||
export const dynamic = "force-dynamic";
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest) {
|
|
||||||
const id = request.nextUrl.searchParams.get("id");
|
|
||||||
// const { searchParams } = new URL(request.url);
|
|
||||||
// const id = searchParams.get("id");
|
|
||||||
|
|
||||||
try {
|
|
||||||
const data = await prisma.kodeOtp.findFirst({
|
|
||||||
where: {
|
|
||||||
id: id as string,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return NextResponse.json(data, { status: 200 });
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NextResponse.json(null, { status: 500 });
|
|
||||||
}
|
|
||||||
67
src/app/api/auth/code/route.ts
Normal file
67
src/app/api/auth/code/route.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import { prisma } from "@/app/lib";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export { DELETE };
|
||||||
|
async function DELETE(request: Request) {
|
||||||
|
if (request.method !== "DELETE") {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Method not allowed" },
|
||||||
|
{ status: 405 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// Ambil parameter nomor dari URL
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const nomor = searchParams.get("nomor");
|
||||||
|
|
||||||
|
// Validasi parameter nomor
|
||||||
|
if (!nomor) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Parameter 'nomor' diperlukan",
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cek apakah data OTP dengan nomor tersebut ada
|
||||||
|
const existingOtp = await prisma.kodeOtp.findFirst({
|
||||||
|
where: { nomor },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!existingOtp) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Data OTP tidak ditemukan",
|
||||||
|
},
|
||||||
|
{ status: 404 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hapus data OTP
|
||||||
|
await prisma.kodeOtp.deleteMany({
|
||||||
|
where: { nomor },
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil menghapus data OTP",
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error deleting OTP:", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Terjadi kesalahan saat menghapus data OTP",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
await prisma.$disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,59 +4,60 @@ import backendLogger from "@/util/backendLogger";
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function POST(req: Request) {
|
export async function POST(req: Request) {
|
||||||
if (req.method === "POST") {
|
if (req.method !== "POST") {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Method Not Allowed" },
|
||||||
|
{ status: 405 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const codeOtp = randomOTP();
|
const codeOtp = randomOTP();
|
||||||
const body = await req.json();
|
const body = await req.json();
|
||||||
const { nomor } = body;
|
const { nomor } = body;
|
||||||
|
const res = await fetch(
|
||||||
try {
|
`https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
|
||||||
const res = await fetch(
|
|
||||||
`https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
|
|
||||||
\n
|
\n
|
||||||
>> Kode OTP anda: ${codeOtp}.
|
>> Kode OTP anda: ${codeOtp}.
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
|
||||||
const sendWa = await res.json();
|
const sendWa = await res.json();
|
||||||
|
|
||||||
if (sendWa.status !== "success")
|
|
||||||
return NextResponse.json(
|
|
||||||
{ success: false, message: "Nomor Whatsapp Tidak Aktif" },
|
|
||||||
{ status: 400 }
|
|
||||||
);
|
|
||||||
|
|
||||||
const createOtpId = await prisma.kodeOtp.create({
|
|
||||||
data: {
|
|
||||||
nomor: nomor,
|
|
||||||
otp: codeOtp,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!createOtpId)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ success: false, message: "Gagal Membuat Kode OTP" },
|
|
||||||
{ status: 400 }
|
|
||||||
);
|
|
||||||
|
|
||||||
|
if (sendWa.status !== "success")
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{
|
{ success: false, message: "Nomor Whatsapp Tidak Aktif" },
|
||||||
success: true,
|
{ status: 400 }
|
||||||
message: "Kode Verifikasi Dikirim",
|
|
||||||
kodeId: createOtpId.id,
|
|
||||||
},
|
|
||||||
{ status: 200 }
|
|
||||||
);
|
);
|
||||||
} catch (error) {
|
|
||||||
backendLogger.log("Error Login", error);
|
const createOtpId = await prisma.kodeOtp.create({
|
||||||
|
data: {
|
||||||
|
nomor: nomor,
|
||||||
|
otp: codeOtp,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!createOtpId)
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ success: false, message: error as Error },
|
{ success: false, message: "Gagal mengirim kode OTP" },
|
||||||
{ status: 500 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Kode verifikasi terkirim",
|
||||||
|
kodeId: createOtpId.id,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
backendLogger.log("Error Login", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Terjadi masalah saat login" , reason: error as Error },
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
await prisma.$disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NextResponse.json(
|
|
||||||
{ success: false, message: "Method Not Allowed" },
|
|
||||||
{ status: 405 }
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,58 +4,60 @@ import backendLogger from "@/util/backendLogger";
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function POST(req: Request) {
|
export async function POST(req: Request) {
|
||||||
if (req.method === "POST") {
|
if (req.method !== "POST") {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Method Not Allowed" },
|
||||||
|
{ status: 405 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const { nomor } = await req.json();
|
const { nomor } = await req.json();
|
||||||
|
const dataUser = await prisma.user.findUnique({
|
||||||
|
where: {
|
||||||
|
nomor: nomor,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
nomor: true,
|
||||||
|
username: true,
|
||||||
|
active: true,
|
||||||
|
masterUserRoleId: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
if (dataUser == null)
|
||||||
const dataUser = await prisma.user.findUnique({
|
|
||||||
where: {
|
|
||||||
nomor: nomor,
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
nomor: true,
|
|
||||||
username: true,
|
|
||||||
active: true,
|
|
||||||
masterUserRoleId: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (dataUser == null)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ success: false, message: "Nomor Belum Terdaftar" },
|
|
||||||
{ status: 404 }
|
|
||||||
);
|
|
||||||
|
|
||||||
const token = await sessionCreate({
|
|
||||||
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
|
|
||||||
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
|
|
||||||
user: dataUser as any,
|
|
||||||
});
|
|
||||||
|
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{
|
{ success: false, message: "Nomor Belum Terdaftar" },
|
||||||
success: true,
|
|
||||||
message: "Berhasil Login",
|
|
||||||
roleId: dataUser.masterUserRoleId,
|
|
||||||
active: dataUser.active,
|
|
||||||
},
|
|
||||||
{ status: 200 }
|
{ status: 200 }
|
||||||
);
|
);
|
||||||
} catch (error) {
|
|
||||||
backendLogger.log("Error Validasi:", error);
|
const token = await sessionCreate({
|
||||||
return NextResponse.json(
|
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
|
||||||
{
|
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
|
||||||
success: false,
|
user: dataUser as any,
|
||||||
message: "Server Error",
|
});
|
||||||
reason: (error as Error).message,
|
|
||||||
},
|
return NextResponse.json(
|
||||||
{ status: 500 }
|
{
|
||||||
);
|
success: true,
|
||||||
}
|
message: "Berhasil Login",
|
||||||
|
roleId: dataUser.masterUserRoleId,
|
||||||
|
active: dataUser.active,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
backendLogger.log("API Error or Server Error", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "API Error or Server Error",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
await prisma.$disconnect();
|
||||||
}
|
}
|
||||||
return NextResponse.json(
|
|
||||||
{ success: false, message: "Method Not Allowed" },
|
|
||||||
{ status: 405 }
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,67 +3,82 @@ import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
|
|
||||||
// GET DATA HOME
|
// GET DATA HOME
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
try {
|
try {
|
||||||
let fixData
|
let fixData;
|
||||||
const { searchParams } = new URL(request.url)
|
const { searchParams } = new URL(request.url);
|
||||||
const kategori = searchParams.get("cat")
|
const kategori = searchParams.get("cat");
|
||||||
|
|
||||||
const userLoginId = await funGetUserIdByToken()
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (userLoginId == null) {
|
if (userLoginId == null) {
|
||||||
return NextResponse.json({ success: false, message: "Gagal mendapatkan data, user id tidak ada" }, { status: 500 });
|
return NextResponse.json(
|
||||||
}
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Gagal mendapatkan data, user id tidak ada",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (kategori == "job") {
|
if (kategori == "job") {
|
||||||
fixData = await prisma.job.findMany({
|
fixData = await prisma.job.findMany({
|
||||||
take: 2,
|
take: 2,
|
||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
isActive: true,
|
isActive: true,
|
||||||
masterStatusId: "1"
|
masterStatusId: "1",
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
Author: {
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
Author: {
|
username: true,
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
username: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
title: true,
|
|
||||||
deskripsi: true
|
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
} else if (kategori == "cek_profile") {
|
title: true,
|
||||||
const data = await prisma.user.findUnique({
|
deskripsi: true,
|
||||||
where: {
|
},
|
||||||
id: userLoginId,
|
});
|
||||||
|
} else if (kategori == "cek_profile") {
|
||||||
|
const data = await prisma.user.findUnique({
|
||||||
|
where: {
|
||||||
|
id: userLoginId,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
},
|
},
|
||||||
include: {
|
},
|
||||||
Profile: {
|
},
|
||||||
select: {
|
});
|
||||||
id: true,
|
|
||||||
imageId: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
fixData = {
|
fixData = {
|
||||||
profile: data?.Profile?.id,
|
profile: data?.Profile?.id,
|
||||||
imageId: data?.Profile?.imageId
|
imageId: data?.Profile?.imageId,
|
||||||
}
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
return NextResponse.json(
|
||||||
|
{ success: true, message: "Berhasil mendapatkan data", data: fixData },
|
||||||
return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: fixData }, { status: 200 });
|
{ status: 200 }
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
|
return NextResponse.json(
|
||||||
}
|
{
|
||||||
}
|
success: false,
|
||||||
|
message: "Gagal mendapatkan data, coba lagi nanti ",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
await prisma.$disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
48
src/app_modules/auth/_lib/api_fetch_auth.ts
Normal file
48
src/app_modules/auth/_lib/api_fetch_auth.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
export {
|
||||||
|
apiFetchLogin,
|
||||||
|
apiGetCheckCodeOtp,
|
||||||
|
apiPostVerifikasiCodeOtp,
|
||||||
|
apiDeleteAktivasiKodeOtpByNomor,
|
||||||
|
};
|
||||||
|
|
||||||
|
const apiFetchLogin = async ({ nomor }: { nomor: string }) => {
|
||||||
|
const respone = await fetch("/api/auth/login", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({ nomor: nomor }),
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return await respone.json().catch(() => null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const apiGetCheckCodeOtp = async ({ id }: { id: string }) => {
|
||||||
|
const respone = await fetch(`/api/auth/check/${id}`);
|
||||||
|
|
||||||
|
return await respone.json().catch(() => null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const apiPostVerifikasiCodeOtp = async ({ nomor }: { nomor: string }) => {
|
||||||
|
const respone = await fetch("/api/auth/validasi", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({ nomor: nomor }),
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return await respone.json().catch(() => null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const apiDeleteAktivasiKodeOtpByNomor = async ({
|
||||||
|
nomor,
|
||||||
|
}: {
|
||||||
|
nomor: string;
|
||||||
|
}) => {
|
||||||
|
const respone = await fetch(`/api/auth/delete/${nomor}`, {
|
||||||
|
method: "DELETE",
|
||||||
|
});
|
||||||
|
|
||||||
|
return await respone.json().catch(() => null);
|
||||||
|
};
|
||||||
@@ -17,6 +17,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { PhoneInput } from "react-international-phone";
|
import { PhoneInput } from "react-international-phone";
|
||||||
import "react-international-phone/style.css";
|
import "react-international-phone/style.css";
|
||||||
|
import { apiFetchLogin } from "../_lib/api_fetch_auth";
|
||||||
|
|
||||||
export default function Login({ version }: { version: string }) {
|
export default function Login({ version }: { version: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -30,33 +31,20 @@ export default function Login({ version }: { version: string }) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const res = await fetch("/api/auth/login", {
|
const respone = await apiFetchLogin({ nomor: nomor });
|
||||||
method: "POST",
|
|
||||||
body: JSON.stringify({ nomor: nomor }),
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const result = await res.json();
|
if (respone) {
|
||||||
|
localStorage.setItem("hipmi_auth_code_id", respone.kodeId);
|
||||||
if (res.status == 500) {
|
ComponentGlobal_NotifikasiBerhasil(respone.message, 2000);
|
||||||
ComponentGlobal_NotifikasiGagal("Server Error");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.status === 200) {
|
|
||||||
localStorage.setItem("hipmi_auth_code_id", result.kodeId);
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(result.message, 2000);
|
|
||||||
router.push("/validasi", { scroll: false });
|
router.push("/validasi", { scroll: false });
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiPeringatan(result.message);
|
setLoading(false);
|
||||||
|
ComponentGlobal_NotifikasiPeringatan(respone.message);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
setLoading(false);
|
||||||
clientLogger.error("Error login:", error);
|
clientLogger.error("Error login:", error);
|
||||||
ComponentGlobal_NotifikasiGagal("Terjadi Kesalahan");
|
ComponentGlobal_NotifikasiGagal("Terjadi Kesalahan");
|
||||||
} finally {
|
|
||||||
setLoading(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_in
|
|||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
|
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
|
||||||
import { Button, Stack, Text, TextInput, Title } from "@mantine/core";
|
import { Button, Center, Stack, Text, TextInput, Title } from "@mantine/core";
|
||||||
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconUserCircle } from "@tabler/icons-react";
|
import { IconUserCircle } from "@tabler/icons-react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
@@ -14,6 +14,8 @@ import { useState } from "react";
|
|||||||
import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
|
import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
|
||||||
import Register_SkeletonView from "./skeleton";
|
import Register_SkeletonView from "./skeleton";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
|
import { apiGetCheckCodeOtp } from "../_lib/api_fetch_auth";
|
||||||
|
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||||
|
|
||||||
export default function Register() {
|
export default function Register() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -39,10 +41,16 @@ export default function Register() {
|
|||||||
kodeId: string;
|
kodeId: string;
|
||||||
onSetData: any;
|
onSetData: any;
|
||||||
}) {
|
}) {
|
||||||
const res = await fetch(`/api/auth/check?id=${kodeId}`);
|
try {
|
||||||
const result = await res.json();
|
const respone = await apiGetCheckCodeOtp({ id: kodeId });
|
||||||
|
if (respone) {
|
||||||
onSetData(result.nomor);
|
onSetData(respone.nomor);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
clientLogger.error("Error onCheckAuthCode:", error);
|
||||||
|
}
|
||||||
|
// const res = await fetch(`/api/auth/check?id=${kodeId}`);
|
||||||
|
// const result = await res.json();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onRegistarsi() {
|
async function onRegistarsi() {
|
||||||
@@ -102,71 +110,75 @@ export default function Register() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<UIGlobal_LayoutDefault>
|
<UIGlobal_LayoutDefault>
|
||||||
{nomor == "" ? (
|
<Stack h={"100vh"} align="center" justify="center" spacing={50}>
|
||||||
<Register_SkeletonView />
|
<Title order={2} c={MainColor.yellow}>
|
||||||
) : (
|
REGISTRASI
|
||||||
<Stack h={"100vh"} align="center" justify="center" spacing={50}>
|
</Title>
|
||||||
<Title order={2} c={MainColor.yellow}>
|
|
||||||
REGISTRASI
|
|
||||||
</Title>
|
|
||||||
|
|
||||||
<IconUserCircle size={100} color={MainColor.white} />
|
<IconUserCircle size={100} color={MainColor.white} />
|
||||||
|
|
||||||
<Stack spacing={"sm"} w={300}>
|
<Stack spacing={"sm"} w={300}>
|
||||||
|
<Stack spacing={0}>
|
||||||
<Text align="center" c={MainColor.white}>
|
<Text align="center" c={MainColor.white}>
|
||||||
Anda akan terdaftar dengan nomor berikut{" "}
|
Anda akan terdaftar dengan nomor
|
||||||
<Text inherit span fw={"bold"}>
|
</Text>
|
||||||
|
{nomor == "" ? (
|
||||||
|
<Center>
|
||||||
|
<CustomSkeleton height={20} w={150} />
|
||||||
|
</Center>
|
||||||
|
) : (
|
||||||
|
<Text align="center" c={MainColor.white} fw={"bold"}>
|
||||||
+{nomor}
|
+{nomor}
|
||||||
</Text>
|
</Text>
|
||||||
</Text>
|
)}
|
||||||
<TextInput
|
</Stack>
|
||||||
ref={focusTrapRef}
|
<TextInput
|
||||||
placeholder="Masukan Username"
|
ref={focusTrapRef}
|
||||||
maxLength={50}
|
placeholder="Masukan Username"
|
||||||
error={
|
maxLength={50}
|
||||||
value.length > 0 && value.length < 5 ? (
|
error={
|
||||||
<ComponentGlobal_ErrorInput text="Minimal 5 karakter !" />
|
value.length > 0 && value.length < 5 ? (
|
||||||
) : _.values(value).includes(" ") ? (
|
<ComponentGlobal_ErrorInput text="Minimal 5 karakter !" />
|
||||||
<Stack spacing={5}>
|
) : _.values(value).includes(" ") ? (
|
||||||
<ComponentGlobal_ErrorInput text="Tidak boleh ada space" />
|
<Stack spacing={5}>
|
||||||
<ComponentGlobal_ErrorInput text="Sambungkan huruf meggunakan karakter _" />
|
<ComponentGlobal_ErrorInput text="Tidak boleh ada space" />
|
||||||
</Stack>
|
<ComponentGlobal_ErrorInput text="Sambungkan huruf meggunakan karakter _" />
|
||||||
) : isValue ? (
|
</Stack>
|
||||||
<ComponentGlobal_ErrorInput text="Masukan username anda" />
|
) : isValue ? (
|
||||||
) : (
|
<ComponentGlobal_ErrorInput text="Masukan username anda" />
|
||||||
""
|
) : (
|
||||||
)
|
""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onChange={(val) => {
|
||||||
|
val.currentTarget.value.length > 0 ? setIsValue(false) : "";
|
||||||
|
setValue(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Stack>
|
||||||
|
<Button
|
||||||
|
disabled={
|
||||||
|
value === "" ||
|
||||||
|
value.length < 5 ||
|
||||||
|
_.values(value).includes(" ")
|
||||||
}
|
}
|
||||||
onChange={(val) => {
|
loading={loading ? true : false}
|
||||||
val.currentTarget.value.length > 0 ? setIsValue(false) : "";
|
loaderPosition="center"
|
||||||
setValue(val.currentTarget.value);
|
radius={"md"}
|
||||||
|
compact
|
||||||
|
h={40}
|
||||||
|
c={"black"}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color={"yellow"}
|
||||||
|
onClick={() => {
|
||||||
|
onRegistarsi();
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Stack>
|
<Text>DAFTAR</Text>
|
||||||
<Button
|
</Button>
|
||||||
disabled={
|
|
||||||
value === "" ||
|
|
||||||
value.length < 5 ||
|
|
||||||
_.values(value).includes(" ")
|
|
||||||
}
|
|
||||||
loading={loading ? true : false}
|
|
||||||
loaderPosition="center"
|
|
||||||
radius={"md"}
|
|
||||||
compact
|
|
||||||
h={40}
|
|
||||||
c={"black"}
|
|
||||||
bg={MainColor.yellow}
|
|
||||||
color={"yellow"}
|
|
||||||
onClick={() => {
|
|
||||||
onRegistarsi();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Text>DAFTAR</Text>
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
</Stack>
|
||||||
</UIGlobal_LayoutDefault>
|
</UIGlobal_LayoutDefault>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_
|
|||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
|
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
|
||||||
import {
|
import {
|
||||||
|
ActionIcon,
|
||||||
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
|
Group,
|
||||||
Loader,
|
Loader,
|
||||||
PinInput,
|
PinInput,
|
||||||
Stack,
|
Stack,
|
||||||
@@ -26,6 +29,14 @@ import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_glo
|
|||||||
import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
|
import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
|
||||||
import Validasi_SkeletonView from "./skeleton";
|
import Validasi_SkeletonView from "./skeleton";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
|
import { IconChevronLeft } from "@tabler/icons-react";
|
||||||
|
import _ from "lodash";
|
||||||
|
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||||
|
import {
|
||||||
|
apiDeleteAktivasiKodeOtpByNomor,
|
||||||
|
apiGetCheckCodeOtp,
|
||||||
|
apiPostVerifikasiCodeOtp,
|
||||||
|
} from "../_lib/api_fetch_auth";
|
||||||
|
|
||||||
export default function Validasi() {
|
export default function Validasi() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -61,20 +72,24 @@ export default function Validasi() {
|
|||||||
}, [triggerOtp]);
|
}, [triggerOtp]);
|
||||||
|
|
||||||
async function onCheckAuthCode({ kodeId }: { kodeId: string }) {
|
async function onCheckAuthCode({ kodeId }: { kodeId: string }) {
|
||||||
const res = await fetch(`/api/auth/check?id=${kodeId}`);
|
try {
|
||||||
const result = await res.json();
|
const respone = await apiGetCheckCodeOtp({ id: kodeId });
|
||||||
|
if (respone) {
|
||||||
setData({
|
setData({
|
||||||
nomor: result.nomor,
|
nomor: respone.nomor,
|
||||||
code: result.otp,
|
code: respone.otp,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
clientLogger.error("Error onCheckAuthCode:", error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
counter > 0 && setTimeout(() => setCounter(counter - 1), 1000);
|
counter > 0 && setTimeout(() => setCounter(counter - 1), 1000);
|
||||||
}, [counter]);
|
}, [counter]);
|
||||||
|
|
||||||
async function onVerifikasi() {
|
async function onSubmitVerifikasi() {
|
||||||
if (!inputCode)
|
if (!inputCode)
|
||||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Kode");
|
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Kode");
|
||||||
if (data.code != inputCode)
|
if (data.code != inputCode)
|
||||||
@@ -82,59 +97,77 @@ export default function Validasi() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const res = await fetch("/api/auth/validasi", {
|
const respone = await apiPostVerifikasiCodeOtp({ nomor: data.nomor });
|
||||||
method: "POST",
|
|
||||||
body: JSON.stringify({
|
|
||||||
nomor: data.nomor,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
const result = await res.json();
|
if (respone && respone.success == true) {
|
||||||
|
if (respone.roleId == "1") {
|
||||||
|
ComponentGlobal_NotifikasiBerhasil(respone.message);
|
||||||
|
localStorage.removeItem("hipmi_auth_code_id");
|
||||||
|
|
||||||
if (res.status === 200 && result.roleId == "1") {
|
router.push(RouterHome.main_home, { scroll: false });
|
||||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
} else if (respone.roleId != "1") {
|
||||||
localStorage.removeItem("hipmi_auth_code_id");
|
ComponentGlobal_NotifikasiBerhasil("Admin berhasil login");
|
||||||
await auth_funDeleteAktivasiKodeOtpByNomor({
|
localStorage.removeItem("hipmi_auth_code_id");
|
||||||
nomor: data.nomor,
|
|
||||||
});
|
|
||||||
|
|
||||||
router.push(RouterHome.main_home, { scroll: false });
|
router.push(RouterAdminDashboard.splash_admin, { scroll: false });
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (res.status === 200 && result.roleId != "1") {
|
try {
|
||||||
ComponentGlobal_NotifikasiBerhasil("Admin Logged in");
|
const responeDelete = await apiDeleteAktivasiKodeOtpByNomor({
|
||||||
localStorage.removeItem("hipmi_auth_code_id");
|
nomor: data.nomor,
|
||||||
await auth_funDeleteAktivasiKodeOtpByNomor({
|
});
|
||||||
nomor: data.nomor,
|
} catch (error) {
|
||||||
});
|
clientLogger.error("Error apiDeleteAktivasiKodeOtpByNomor:", error);
|
||||||
|
}
|
||||||
router.push(RouterAdminDashboard.splash_admin, { scroll: false });
|
} else if (respone && respone.success == false) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.status === 404) {
|
|
||||||
setLoading(false);
|
|
||||||
router.push("/register", { scroll: false });
|
router.push("/register", { scroll: false });
|
||||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
ComponentGlobal_NotifikasiBerhasil(respone.message);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.status === 400) {
|
// if (respone.status === 200 && result.roleId == "1") {
|
||||||
setLoading(false);
|
// ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||||
ComponentGlobal_NotifikasiPeringatan(result.message);
|
// localStorage.removeItem("hipmi_auth_code_id");
|
||||||
return;
|
// await auth_funDeleteAktivasiKodeOtpByNomor({
|
||||||
}
|
// nomor: data.nomor,
|
||||||
|
// });
|
||||||
|
|
||||||
if (res.status == 500) {
|
// router.push(RouterHome.main_home, { scroll: false });
|
||||||
setLoading(false);
|
// return;
|
||||||
ComponentGlobal_NotifikasiGagal(result.message);
|
// }
|
||||||
return;
|
|
||||||
}
|
// if (respone.status === 200 && result.roleId != "1") {
|
||||||
|
// ComponentGlobal_NotifikasiBerhasil("Admin Logged in");
|
||||||
|
// localStorage.removeItem("hipmi_auth_code_id");
|
||||||
|
// await auth_funDeleteAktivasiKodeOtpByNomor({
|
||||||
|
// nomor: data.nomor,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// router.push(RouterAdminDashboard.splash_admin, { scroll: false });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (respone.status === 404) {
|
||||||
|
// setLoading(false);
|
||||||
|
// router.push("/register", { scroll: false });
|
||||||
|
// ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (respone.status === 400) {
|
||||||
|
// setLoading(false);
|
||||||
|
// ComponentGlobal_NotifikasiPeringatan(result.message);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (respone.status == 500) {
|
||||||
|
// setLoading(false);
|
||||||
|
// ComponentGlobal_NotifikasiGagal(result.message);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
clientLogger.error("Error validasi:", error);
|
clientLogger.error("Error validasi:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onBack() {
|
async function onBack() {
|
||||||
@@ -176,8 +209,6 @@ export default function Validasi() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(data.code);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<UIGlobal_LayoutDefault>
|
<UIGlobal_LayoutDefault>
|
||||||
@@ -194,84 +225,88 @@ export default function Validasi() {
|
|||||||
<IconChevronLeft color="white" />
|
<IconChevronLeft color="white" />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Box> */}
|
</Box> */}
|
||||||
{data.nomor == "" && data.code == "" ? (
|
|
||||||
<Validasi_SkeletonView />
|
|
||||||
) : (
|
|
||||||
<Stack align="center" justify="center" h={"100vh"} spacing={50}>
|
|
||||||
<Title order={2} color={MainColor.yellow}>
|
|
||||||
Verifikasi Kode OTP
|
|
||||||
</Title>
|
|
||||||
|
|
||||||
<Stack spacing={"md"} align="center">
|
<Stack align="center" justify="center" h={"100vh"} spacing={50}>
|
||||||
<Stack spacing={0} align="center">
|
<Title order={2} color={MainColor.yellow}>
|
||||||
<Text c={MainColor.white}>Masukan 4 digit kode otp</Text>
|
Verifikasi Kode OTP
|
||||||
<Text c={MainColor.white}>
|
</Title>
|
||||||
Yang dikirim ke{" "}
|
|
||||||
<Text span inherit fw={"bold"}>
|
<Stack spacing={"md"} align="center">
|
||||||
{" "}
|
<Stack spacing={0} align="center">
|
||||||
|
<Text c={MainColor.white}>Masukan 4 digit kode otp</Text>
|
||||||
|
<Group position="center" spacing={"xs"}>
|
||||||
|
<Text c={MainColor.white}>Yang dikirim ke</Text>
|
||||||
|
{data && data.nomor !== "" ? (
|
||||||
|
<Text fw={"bold"} c={MainColor.white}>
|
||||||
+{data.nomor}
|
+{data.nomor}
|
||||||
</Text>
|
</Text>
|
||||||
</Text>
|
) : (
|
||||||
</Stack>
|
<CustomSkeleton height={15} radius={"xl"} width={150} />
|
||||||
<Center>
|
)}
|
||||||
<PinInput
|
</Group>
|
||||||
size="xl"
|
</Stack>
|
||||||
type={"number"}
|
<Center>
|
||||||
ref={focusTrapRef}
|
<PinInput
|
||||||
spacing={"md"}
|
size="xl"
|
||||||
mt={"md"}
|
type={"number"}
|
||||||
styles={{ input: { backgroundColor: MainColor.white } }}
|
ref={focusTrapRef}
|
||||||
onChange={(val) => {
|
spacing={"md"}
|
||||||
setInputOtp(val);
|
mt={"md"}
|
||||||
}}
|
styles={{ input: { backgroundColor: MainColor.white } }}
|
||||||
/>
|
onChange={(val) => {
|
||||||
</Center>
|
setInputOtp(val);
|
||||||
|
}}
|
||||||
<Stack h={"5vh"} align="center" justify="center">
|
/>
|
||||||
<Text fs="italic" c={MainColor.white}>
|
</Center>
|
||||||
Tidak menerima kode ?{" "}
|
|
||||||
{counter > 0 ? (
|
<Stack h={"5vh"} align="center" justify="center">
|
||||||
<Text fw={"bold"} inherit span>
|
<Text fs="italic" c={MainColor.white}>
|
||||||
{counter + "s"}
|
Tidak menerima kode ?{" "}
|
||||||
</Text>
|
{counter > 0 ? (
|
||||||
) : loadingResend ? (
|
<Text fw={"bold"} inherit span>
|
||||||
<Loader ml={"sm"} size={"xs"} color="yellow" />
|
{counter + "s"}
|
||||||
) : (
|
</Text>
|
||||||
<Text
|
) : loadingResend ? (
|
||||||
inherit
|
<Loader ml={"sm"} size={"xs"} color="yellow" />
|
||||||
span
|
) : (
|
||||||
onClick={() => {
|
<Text
|
||||||
onResendCode();
|
inherit
|
||||||
}}
|
span
|
||||||
fw={"bold"}
|
onClick={() => {
|
||||||
>
|
onResendCode();
|
||||||
Kirim ulang
|
}}
|
||||||
</Text>
|
fw={"bold"}
|
||||||
)}
|
>
|
||||||
</Text>
|
Kirim ulang
|
||||||
</Stack>
|
</Text>
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Button
|
|
||||||
w={300}
|
|
||||||
loading={loading ? true : false}
|
|
||||||
loaderPosition="center"
|
|
||||||
radius={"md"}
|
|
||||||
compact
|
|
||||||
h={40}
|
|
||||||
c={"black"}
|
|
||||||
bg={MainColor.yellow}
|
|
||||||
color={"yellow"}
|
|
||||||
style={{
|
|
||||||
borderColor: AccentColor.yellow,
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
onVerifikasi();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Text>VERIFIKASI</Text>
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
<Button
|
||||||
|
w={300}
|
||||||
|
loading={loading ? true : false}
|
||||||
|
loaderPosition="center"
|
||||||
|
radius={"md"}
|
||||||
|
compact
|
||||||
|
h={40}
|
||||||
|
c={"black"}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color={"yellow"}
|
||||||
|
style={{
|
||||||
|
borderColor: AccentColor.yellow,
|
||||||
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
data.nomor == "" && data.code == ""
|
||||||
|
? null
|
||||||
|
: onSubmitVerifikasi();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text>VERIFIKASI</Text>
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
{/* {data.nomor == "" && data.code == "" ? <Validasi_SkeletonView /> : ""} */}
|
||||||
</Stack>
|
</Stack>
|
||||||
</UIGlobal_LayoutDefault>
|
</UIGlobal_LayoutDefault>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { RouterEvent } from '@/app/lib/router_hipmi/router_event';
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
import { AccentColor, MainColor } from '@/app_modules/_global/color';
|
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||||
import { ActionIcon, Flex, Loader, Paper, Text } from '@mantine/core';
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
|
||||||
import { IconStar } from '@tabler/icons-react';
|
import { ActionIcon, Flex, Loader, Paper, Text } from "@mantine/core";
|
||||||
import { useParams, useRouter } from 'next/navigation';
|
import { IconStar } from "@tabler/icons-react";
|
||||||
import { useState } from 'react';
|
import { useParams, useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
function Event_ComponentBoxDaftarSponsor() {
|
function Event_ComponentBoxDaftarSponsor() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -20,11 +21,11 @@ function Event_ComponentBoxDaftarSponsor() {
|
|||||||
color: "white",
|
color: "white",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoading(true);
|
// setLoading(true);
|
||||||
router.push(RouterEvent.daftar_sponsor({ id: params.id }), {
|
// router.push(RouterEvent.daftar_sponsor({ id: params.id }), {
|
||||||
scroll: false,
|
// scroll: false,
|
||||||
});
|
// });
|
||||||
// router.push(RouterInvestasi_OLD.detail_dokumen + investasiId, { scroll: false });
|
ComponentGlobal_NotifikasiPeringatan("Fitur belum tersedia");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
<Flex direction={"column"} align={"center"} justify={"center"}>
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
|||||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
|
||||||
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||||
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Box,
|
Box,
|
||||||
Flex,
|
|
||||||
Grid,
|
Grid,
|
||||||
Group,
|
Group,
|
||||||
Image,
|
Image,
|
||||||
@@ -22,40 +22,20 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { apiGetDataHome } from "../fun/get/api_home";
|
import { apiGetDataHome } from "../fun/get/api_home";
|
||||||
import { listMenuHomeBody, menuHomeJob } from "./list_menu_home";
|
import { listMenuHomeBody, menuHomeJob } from "./list_menu_home";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
|
||||||
|
|
||||||
export default function BodyHome() {
|
export default function BodyHome({ dataUser }: { dataUser: any | null }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [dataUser, setDataUser] = useState<any | null>(null);
|
|
||||||
const [dataJob, setDataJob] = useState<any[] | null>(null);
|
const [dataJob, setDataJob] = useState<any[] | null>(null);
|
||||||
const [loadingJob, setLoadingJob] = useState(true);
|
const [loadingJob, setLoadingJob] = useState(true);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
cekUserLogin();
|
|
||||||
getHomeJob();
|
getHomeJob();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
async function cekUserLogin() {
|
|
||||||
try {
|
|
||||||
const response = await apiGetDataHome({
|
|
||||||
path: "?cat=cek_profile",
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response) {
|
|
||||||
setDataUser(response.data);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
clientLogger.error("Error get data profile", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function getHomeJob() {
|
async function getHomeJob() {
|
||||||
try {
|
try {
|
||||||
setLoadingJob(true);
|
setLoadingJob(true);
|
||||||
|
|
||||||
const response = await apiGetDataHome({
|
const response = await apiGetDataHome({
|
||||||
path: "?cat=job",
|
path: "?cat=job",
|
||||||
});
|
});
|
||||||
@@ -101,21 +81,14 @@ export default function BodyHome() {
|
|||||||
border: `2px solid ${AccentColor.blue}`,
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (dataUser == null) {
|
if (!dataUser) {
|
||||||
return null;
|
return null;
|
||||||
} else if (
|
} else if (dataUser.profile === undefined) {
|
||||||
Object.keys(dataUser).length == 0 ||
|
|
||||||
dataJob?.length == null
|
|
||||||
) {
|
|
||||||
router.push(RouterProfile.create, { scroll: false });
|
router.push(RouterProfile.create, { scroll: false });
|
||||||
|
} else if (e.link == "") {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan("Cooming Soon");
|
||||||
} else {
|
} else {
|
||||||
if (e.link == "") {
|
router.push(e.link, { scroll: false });
|
||||||
return ComponentGlobal_NotifikasiPeringatan(
|
|
||||||
"Cooming Soon !!"
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
router.push(e.link, { scroll: false });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -147,21 +120,14 @@ export default function BodyHome() {
|
|||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (dataUser == null) {
|
if (!dataUser) {
|
||||||
return null;
|
return null;
|
||||||
} else if (
|
} else if (dataUser.profile === undefined) {
|
||||||
Object.keys(dataUser).length == 0 ||
|
|
||||||
dataJob?.length == null
|
|
||||||
) {
|
|
||||||
router.push(RouterProfile.create, { scroll: false });
|
router.push(RouterProfile.create, { scroll: false });
|
||||||
|
} else if (menuHomeJob.link == "") {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan("Cooming Soon ");
|
||||||
} else {
|
} else {
|
||||||
if (menuHomeJob.link == "") {
|
router.push(menuHomeJob.link, { scroll: false });
|
||||||
return ComponentGlobal_NotifikasiPeringatan(
|
|
||||||
"Cooming Soon !!"
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return router.push(menuHomeJob.link, { scroll: false });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { APIs } from "@/app/lib";
|
import { APIs } from "@/app/lib";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
|
||||||
|
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Box,
|
Box,
|
||||||
@@ -9,37 +11,14 @@ import {
|
|||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
|
||||||
import { IconUserCircle } from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
|
||||||
import { apiGetDataHome } from "../fun/get/api_home";
|
|
||||||
import { Home_ComponentAvatarProfile } from "./comp_avatar_profile";
|
import { Home_ComponentAvatarProfile } from "./comp_avatar_profile";
|
||||||
import { listMenuHomeFooter } from "./list_menu_home";
|
import { listMenuHomeFooter } from "./list_menu_home";
|
||||||
import { MainColor } from "@/app_modules/_global/color";
|
import { IconUser } from "@tabler/icons-react";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { IconUserCircle } from "@tabler/icons-react";
|
||||||
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
|
|
||||||
|
|
||||||
export default function FooterHome() {
|
export default function FooterHome({ dataUser }: { dataUser: any | null }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [dataUser, setDataUser] = useState<any | null>(null);
|
|
||||||
|
|
||||||
useShallowEffect(() => {
|
|
||||||
cekUserLogin();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
async function cekUserLogin() {
|
|
||||||
try {
|
|
||||||
const response = await apiGetDataHome({
|
|
||||||
path: "?cat=cek_profile",
|
|
||||||
});
|
|
||||||
if (response) {
|
|
||||||
setDataUser(response.data);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
clientLogger.error("Error get data profile", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -51,95 +30,81 @@ export default function FooterHome() {
|
|||||||
bottom={0}
|
bottom={0}
|
||||||
h={"9vh"}
|
h={"9vh"}
|
||||||
>
|
>
|
||||||
{dataUser == null ? (
|
<SimpleGrid cols={listMenuHomeFooter.length + 1}>
|
||||||
<SimpleGrid cols={4}>
|
{listMenuHomeFooter.map((e) => (
|
||||||
{Array.from(new Array(4)).map((_, i) => (
|
<Center h={"9vh"} key={e.id}>
|
||||||
<Center h={"9vh"} key={i}>
|
|
||||||
<Stack align="center">
|
|
||||||
<CustomSkeleton radius={"lg"} height={40} w={40} />
|
|
||||||
</Stack>
|
|
||||||
</Center>
|
|
||||||
))}
|
|
||||||
</SimpleGrid>
|
|
||||||
) : (
|
|
||||||
<SimpleGrid cols={listMenuHomeFooter.length + 1}>
|
|
||||||
{listMenuHomeFooter.map((e) => (
|
|
||||||
<Center h={"9vh"} key={e.id}>
|
|
||||||
<Stack
|
|
||||||
align="center"
|
|
||||||
spacing={0}
|
|
||||||
onClick={() => {
|
|
||||||
if (dataUser == null) {
|
|
||||||
return null;
|
|
||||||
} else if (Object.keys(dataUser).length === 0) {
|
|
||||||
router.push(RouterProfile.create, { scroll: false });
|
|
||||||
} else {
|
|
||||||
if (e.link == "") {
|
|
||||||
ComponentGlobal_NotifikasiPeringatan("Cooming Soon");
|
|
||||||
} else {
|
|
||||||
router.push(e.link, { scroll: false });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ActionIcon
|
|
||||||
radius={"xl"}
|
|
||||||
c={e.link === "" ? "gray" : MainColor.white}
|
|
||||||
variant="transparent"
|
|
||||||
>
|
|
||||||
{e.icon}
|
|
||||||
</ActionIcon>
|
|
||||||
<Text
|
|
||||||
lineClamp={1}
|
|
||||||
c={e.link === "" ? "gray" : MainColor.white}
|
|
||||||
fz={12}
|
|
||||||
>
|
|
||||||
{e.name}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Center>
|
|
||||||
))}
|
|
||||||
|
|
||||||
<Center h={"9vh"}>
|
|
||||||
<Stack
|
<Stack
|
||||||
align="center"
|
align="center"
|
||||||
spacing={2}
|
spacing={0}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (
|
if (!dataUser) {
|
||||||
dataUser.profile === undefined ||
|
return null;
|
||||||
dataUser?.profile === null
|
} else if (dataUser.profile === undefined) {
|
||||||
) {
|
|
||||||
router.push(RouterProfile.create, { scroll: false });
|
router.push(RouterProfile.create, { scroll: false });
|
||||||
|
} else if (e.link == "") {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan("Cooming Soon");
|
||||||
} else {
|
} else {
|
||||||
|
router.push(e.link, { scroll: false });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ActionIcon
|
||||||
|
radius={"xl"}
|
||||||
|
c={e.link === "" ? "gray" : MainColor.white}
|
||||||
|
variant="transparent"
|
||||||
|
>
|
||||||
|
{e.icon}
|
||||||
|
</ActionIcon>
|
||||||
|
<Text
|
||||||
|
lineClamp={1}
|
||||||
|
c={e.link === "" ? "gray" : MainColor.white}
|
||||||
|
fz={12}
|
||||||
|
>
|
||||||
|
{e.name}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Center>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<Center h={"9vh"}>
|
||||||
|
<Stack align="center" spacing={2}>
|
||||||
|
{!dataUser ? (
|
||||||
|
<CustomSkeleton height={25} width={25} radius={"xl"} />
|
||||||
|
) : dataUser.profile === undefined ? (
|
||||||
|
<ActionIcon
|
||||||
|
variant={"transparent"}
|
||||||
|
onClick={() =>
|
||||||
|
router.push(RouterProfile.create, { scroll: false })
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<IconUserCircle color="white" />
|
||||||
|
</ActionIcon>
|
||||||
|
) : (
|
||||||
|
<ActionIcon
|
||||||
|
variant={"transparent"}
|
||||||
|
onClick={() => {
|
||||||
router.push(
|
router.push(
|
||||||
RouterProfile.katalogOLD + `${dataUser?.profile}`,
|
RouterProfile.katalogOLD + `${dataUser?.profile}`,
|
||||||
{
|
{
|
||||||
scroll: false,
|
scroll: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}}
|
||||||
}}
|
>
|
||||||
>
|
<Home_ComponentAvatarProfile
|
||||||
<ActionIcon variant={"transparent"}>
|
url={APIs.GET({
|
||||||
{dataUser.profile === undefined ||
|
fileId: dataUser?.imageId as string,
|
||||||
dataUser?.profile === null ? (
|
size: "50",
|
||||||
<IconUserCircle color={MainColor.white} />
|
})}
|
||||||
) : (
|
/>
|
||||||
<Home_ComponentAvatarProfile
|
|
||||||
url={APIs.GET({
|
|
||||||
fileId: dataUser?.imageId as string,
|
|
||||||
size: "50",
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
<Text fz={10} c={MainColor.white}>
|
)}
|
||||||
Profile
|
<Text fz={10} c={MainColor.white}>
|
||||||
</Text>
|
Profile
|
||||||
</Stack>
|
</Text>
|
||||||
</Center>
|
</Stack>
|
||||||
</SimpleGrid>
|
</Center>
|
||||||
)}
|
</SimpleGrid>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { API_RouteNotifikasi } from "@/app/lib/api_user_router/route_api_notifikasi";
|
import { API_RouteNotifikasi } from "@/app/lib/api_user_router/route_api_notifikasi";
|
||||||
import { gs_count_ntf, gs_user_ntf } from "@/app/lib/global_state";
|
import { gs_count_ntf, gs_user_ntf } from "@/app/lib/global_state";
|
||||||
|
import global_limit from "@/app/lib/limit";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi";
|
import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi";
|
||||||
import { RouterUserSearch } from "@/app/lib/router_hipmi/router_user_search";
|
import { RouterUserSearch } from "@/app/lib/router_hipmi/router_user_search";
|
||||||
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
import { ActionIcon, Indicator, Text } from "@mantine/core";
|
import { ActionIcon, Indicator, Text } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconBell, IconUserSearch } from "@tabler/icons-react";
|
import { IconBell, IconUserSearch } from "@tabler/icons-react";
|
||||||
@@ -17,8 +19,6 @@ import { gs_notifikasi_kategori_app } from "../notifikasi/lib";
|
|||||||
import BodyHome from "./component/body_home";
|
import BodyHome from "./component/body_home";
|
||||||
import FooterHome from "./component/footer_home";
|
import FooterHome from "./component/footer_home";
|
||||||
import { apiGetDataHome } from "./fun/get/api_home";
|
import { apiGetDataHome } from "./fun/get/api_home";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
|
||||||
import CustomSkeleton from "../components/CustomSkeleton";
|
|
||||||
|
|
||||||
export default function HomeViewNew() {
|
export default function HomeViewNew() {
|
||||||
const [countNtf, setCountNtf] = useAtom(gs_count_ntf);
|
const [countNtf, setCountNtf] = useAtom(gs_count_ntf);
|
||||||
@@ -27,10 +27,6 @@ export default function HomeViewNew() {
|
|||||||
const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
|
const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
useShallowEffect(() => {
|
|
||||||
onLoadNotifikasi();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
if (countNtf != null) {
|
if (countNtf != null) {
|
||||||
setCountNtf(countNtf + newUserNtf);
|
setCountNtf(countNtf + newUserNtf);
|
||||||
@@ -38,15 +34,32 @@ export default function HomeViewNew() {
|
|||||||
}
|
}
|
||||||
}, [newUserNtf, countNtf]);
|
}, [newUserNtf, countNtf]);
|
||||||
|
|
||||||
async function onLoadNotifikasi() {
|
useShallowEffect(() => {
|
||||||
const loadNotif = await fetch(API_RouteNotifikasi.get_count_by_id());
|
hanlderLoadData();
|
||||||
const data = await loadNotif.json().then((res) => res.data);
|
}, []);
|
||||||
setCountNtf(data);
|
|
||||||
|
async function hanlderLoadData() {
|
||||||
|
try {
|
||||||
|
const listLoadData = [
|
||||||
|
global_limit(() => onLoadNotifikasi()),
|
||||||
|
global_limit(() => cekUserLogin()),
|
||||||
|
];
|
||||||
|
|
||||||
|
await Promise.all(listLoadData);
|
||||||
|
} catch (error) {
|
||||||
|
clientLogger.error("Error handler load data", error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useShallowEffect(() => {
|
async function onLoadNotifikasi() {
|
||||||
cekUserLogin();
|
try {
|
||||||
}, []);
|
const loadNotif = await fetch(API_RouteNotifikasi.get_count_by_id());
|
||||||
|
const data = await loadNotif.json().then((res) => res.data);
|
||||||
|
setCountNtf(data);
|
||||||
|
} catch (error) {
|
||||||
|
clientLogger.error("Error load notifikasi", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function cekUserLogin() {
|
async function cekUserLogin() {
|
||||||
try {
|
try {
|
||||||
@@ -68,22 +81,26 @@ export default function HomeViewNew() {
|
|||||||
<UIGlobal_LayoutHeaderTamplate
|
<UIGlobal_LayoutHeaderTamplate
|
||||||
title="HIPMI"
|
title="HIPMI"
|
||||||
customButtonLeft={
|
customButtonLeft={
|
||||||
dataUser == null ? (
|
!dataUser && !countNtf ? (
|
||||||
<CustomSkeleton width={20} height={20} circle />
|
<ActionIcon radius={"xl"} variant={"transparent"}>
|
||||||
|
<IconUserSearch color={MainColor.white} />
|
||||||
|
</ActionIcon>
|
||||||
|
) : dataUser.profile === undefined ? (
|
||||||
|
<ActionIcon
|
||||||
|
radius={"xl"}
|
||||||
|
variant={"transparent"}
|
||||||
|
onClick={() => {
|
||||||
|
router.push(RouterProfile.create, { scroll: false });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconUserSearch color={MainColor.white} />
|
||||||
|
</ActionIcon>
|
||||||
) : (
|
) : (
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
disabled={countNtf == null}
|
|
||||||
variant={"transparent"}
|
variant={"transparent"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (
|
router.push(RouterUserSearch.main, { scroll: false });
|
||||||
dataUser.profile != undefined ||
|
|
||||||
dataUser?.profile != null
|
|
||||||
) {
|
|
||||||
router.push(RouterUserSearch.main, { scroll: false });
|
|
||||||
} else {
|
|
||||||
router.push(RouterProfile.create, { scroll: false });
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconUserSearch color={MainColor.white} />
|
<IconUserSearch color={MainColor.white} />
|
||||||
@@ -91,27 +108,32 @@ export default function HomeViewNew() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
customButtonRight={
|
customButtonRight={
|
||||||
dataUser == null ? (
|
!dataUser && !countNtf ? (
|
||||||
<CustomSkeleton width={20} height={20} circle />
|
<ActionIcon radius={"xl"} variant={"transparent"}>
|
||||||
|
<IconBell color={MainColor.white} />
|
||||||
|
</ActionIcon>
|
||||||
|
) : dataUser.profile === undefined ? (
|
||||||
|
<ActionIcon
|
||||||
|
radius={"xl"}
|
||||||
|
variant={"transparent"}
|
||||||
|
onClick={() => {
|
||||||
|
router.push(RouterProfile.create, { scroll: false });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconBell color={MainColor.white} />
|
||||||
|
</ActionIcon>
|
||||||
) : (
|
) : (
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
disabled={countNtf == null}
|
disabled={countNtf == null}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (
|
setCategoryPage("Semua");
|
||||||
dataUser.profile != undefined ||
|
router.push(
|
||||||
dataUser?.profile != null
|
RouterNotifikasi.categoryApp({ name: "semua" }),
|
||||||
) {
|
{
|
||||||
setCategoryPage("Semua");
|
scroll: false,
|
||||||
router.push(
|
}
|
||||||
RouterNotifikasi.categoryApp({ name: "semua" }),
|
);
|
||||||
{
|
|
||||||
scroll: false,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
router.push(RouterProfile.create, { scroll: false });
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{countNtf != null && countNtf > 0 ? (
|
{countNtf != null && countNtf > 0 ? (
|
||||||
@@ -134,9 +156,9 @@ export default function HomeViewNew() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
footer={<FooterHome />}
|
footer={<FooterHome dataUser={dataUser} />}
|
||||||
>
|
>
|
||||||
<BodyHome />
|
<BodyHome dataUser={dataUser} />
|
||||||
</UIGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const middlewareConfig: MiddlewareConfig = {
|
|||||||
"/api/auth/*",
|
"/api/auth/*",
|
||||||
"/api/origin-url",
|
"/api/origin-url",
|
||||||
"/api/event/*",
|
"/api/event/*",
|
||||||
"/api/master/*",
|
// "/api/master/*",
|
||||||
// "/api/image/*",
|
// "/api/image/*",
|
||||||
// "/api/user/*",
|
// "/api/user/*",
|
||||||
// "/api/new/*",
|
// "/api/new/*",
|
||||||
|
|||||||
Reference in New Issue
Block a user