mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-10-28 20:23:09 +00:00
Implement new features and enhance existing components for improved user experience
- Added a new `bun.lockb` file for dependency management. - Updated `next.config.ts` to set output to "standalone" for better deployment options. - Removed `package-lock.json` to streamline package management. - Modified `package.json` to update dependencies, including `@prisma/client` and `sonner`, and adjusted build scripts for improved functionality. - Enhanced Tailwind CSS configuration to include new animations and color schemes. - Refactored various dashboard components to improve UI consistency, including adding a new `My Wallet` page and updating existing pages to use a unified styling approach. - Introduced a new `BlockDeviceDialog` component for managing device blocking with user-defined reasons. - Improved logging and error handling in payment verification and device management functions. These changes enhance the overall functionality, maintainability, and user experience of the application.
This commit is contained in:
@@ -56,7 +56,7 @@ export async function addDevicesToGroup({
|
||||
try {
|
||||
// Fetch the existing group profiles
|
||||
const groupProfiles: OmadaResponse = await fetchOmadaGroupProfiles(siteId);
|
||||
console.log(groupProfiles);
|
||||
// console.log(groupProfiles);
|
||||
// Find the group profile with the specified groupId
|
||||
const groupProfile: GroupProfile | undefined =
|
||||
groupProfiles.result.data.find((profile) => profile.groupId === groupId);
|
||||
@@ -70,7 +70,7 @@ export async function addDevicesToGroup({
|
||||
...(groupProfile.macAddressList || []),
|
||||
...newDevices,
|
||||
];
|
||||
console.log({ updatedMacAddressList });
|
||||
// console.log({ updatedMacAddressList });
|
||||
// Prepare the request payload
|
||||
const requestBody = {
|
||||
name: groupProfile.name,
|
||||
@@ -112,7 +112,8 @@ export async function addDevicesToGroup({
|
||||
export async function blockDevice({
|
||||
macAddress,
|
||||
type,
|
||||
}: { macAddress: string; type: "block" | "unblock" }) {
|
||||
reason
|
||||
}: { macAddress: string; type: "block" | "unblock", reason?: string }) {
|
||||
console.log("hello world asdasd");
|
||||
if (!macAddress) {
|
||||
throw new Error("macAddress is a required parameter");
|
||||
@@ -144,6 +145,7 @@ export async function blockDevice({
|
||||
id: device?.id,
|
||||
},
|
||||
data: {
|
||||
reasonForBlocking: type === "block" ? reason : "",
|
||||
blocked: type === "block",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -107,6 +107,7 @@ async function verifyExternalPayment(
|
||||
data: VerifyPaymentType,
|
||||
payment: PaymentWithDevices | null,
|
||||
): Promise<VerifyPaymentResponse> {
|
||||
console.log('payment verify data ->', data)
|
||||
const response = await fetch(
|
||||
"https://verifypaymentsapi.baraveli.dev/verify-payment",
|
||||
{
|
||||
@@ -117,7 +118,7 @@ async function verifyExternalPayment(
|
||||
);
|
||||
|
||||
const json = await response.json();
|
||||
|
||||
console.log(json)
|
||||
if (!payment) {
|
||||
throw new Error("Payment verification failed or payment not found");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user