diff --git a/CHANGELOG.md b/CHANGELOG.md
index d36577a4..8d318a0b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
+## [1.5.15](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.14...v1.5.15) (2025-11-18)
+
## [1.5.14](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.13...v1.5.14) (2025-11-17)
## [1.5.13](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.12...v1.5.13) (2025-11-17)
diff --git a/package.json b/package.json
index c386af89..362fa47a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "hipmi",
- "version": "1.5.14",
+ "version": "1.5.15",
"private": true,
"prisma": {
"seed": "bun prisma/seed.ts"
diff --git a/src/app/(support)/delete-account/page.tsx b/src/app/(support)/delete-account/page.tsx
index a0fd0478..a7c285cf 100644
--- a/src/app/(support)/delete-account/page.tsx
+++ b/src/app/(support)/delete-account/page.tsx
@@ -20,6 +20,7 @@ export default function DeleteAccount() {
const [data, setData] = useState({
description: "",
});
+ const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
// Hanya di client, setelah mount
@@ -31,15 +32,32 @@ export default function DeleteAccount() {
}, []);
const handlerSubmit = async () => {
- if (!phoneNumber || !data.description) {
+ if (!phoneNumber) {
return notifications.show({
title: "Error",
- message: "Please fill in description & phone number",
+ message: "Please check your phone number",
+ color: "red",
+ });
+ }
+
+ if (!data.description) {
+ return notifications.show({
+ title: "Error",
+ message: "Please fill in description with 'Delete Account'",
+ color: "red",
+ });
+ }
+
+ if (data.description !== "Delete Account") {
+ return notifications.show({
+ title: "Error",
+ message: "Please fill in description with 'Delete Account'",
color: "red",
});
}
try {
+ setIsLoading(true);
const response = await fetch("/api/helper/delete-account", {
method: "POST",
headers: {
@@ -67,12 +85,14 @@ export default function DeleteAccount() {
if (!result.success) {
notifications.show({
title: "Error",
- message: result.error,
+ message: result.error || "Failed to delete account.",
color: "red",
});
}
} catch (error) {
console.log(error);
+ } finally {
+ setIsLoading(false);
}
};
@@ -121,7 +141,7 @@ export default function DeleteAccount() {
/>
-
diff --git a/src/app/(support)/support-center/page.tsx b/src/app/(support)/support-center/page.tsx
index 1625a924..9b23a078 100644
--- a/src/app/(support)/support-center/page.tsx
+++ b/src/app/(support)/support-center/page.tsx
@@ -1,15 +1,15 @@
"use client";
import {
- Box,
- Button,
- Group,
- Paper,
- SimpleGrid,
- Stack,
- Text,
- Textarea,
- TextInput,
- Title
+ Box,
+ Button,
+ Group,
+ Paper,
+ SimpleGrid,
+ Stack,
+ Text,
+ Textarea,
+ TextInput,
+ Title,
} from "@mantine/core";
import { notifications } from "@mantine/notifications";
import { IconBrandGmail, IconLocation } from "@tabler/icons-react";
@@ -22,6 +22,7 @@ export default function SupportCenter() {
title: "",
description: "",
});
+ const [isLoading, setLoading] = useState(false);
const handleSubmit = async () => {
if (!data.email || !data.title || !data.description) {
@@ -32,35 +33,43 @@ export default function SupportCenter() {
});
}
- const response = await fetch("/api/helper/support-center", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify(data),
- });
- const result = await response.json();
+ try {
+ setLoading(true);
- if (result.success) {
- notifications.show({
- title: "Success",
- color: "green",
- message: "Message sent successfully.",
+ const response = await fetch("/api/helper/support-center", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(data),
});
+ const result = await response.json();
- setData({
- email: "",
- title: "",
- description: "",
- });
- }
+ if (result.success) {
+ notifications.show({
+ title: "Success",
+ color: "green",
+ message: "Message sent successfully.",
+ });
- if (!result.success) {
- notifications.show({
- title: "Error",
- color: "red",
- message: result.error,
- });
+ setData({
+ email: "",
+ title: "",
+ description: "",
+ });
+ }
+
+ if (!result.success) {
+ notifications.show({
+ title: "Error",
+ color: "red",
+ message: result.error || "Failed to send message.",
+ });
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoading(false);
}
};
@@ -177,7 +186,11 @@ export default function SupportCenter() {
}}
/>
- handleSubmit()}>
+ handleSubmit()}
+ >
Submit
diff --git a/src/app/api/helper/support-center/route.ts b/src/app/api/helper/support-center/route.ts
index 35c9b6e6..6d2e6534 100644
--- a/src/app/api/helper/support-center/route.ts
+++ b/src/app/api/helper/support-center/route.ts
@@ -18,7 +18,8 @@ export async function POST(req: Request) {
const data = await resend.emails.send({
from: `${email} `,
- to: ["bip.baliinteraktifperkasa@gmail.com"], // ganti sesuai email kamu
+ to: ["bagasbanuna02@gmail.com"],
+ // to: ["bip.baliinteraktifperkasa@gmail.com"],
subject: title,
html: `