feat(admin-topup): add description field to topup form and validation for amount
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 8m56s

fix(verify-registration-otp): improve styling and structure of OTP verification form
This commit is contained in:
2025-07-27 16:01:15 +05:00
parent 76a4e3d66e
commit 3da668a94a
3 changed files with 45 additions and 16 deletions

View File

@ -11,14 +11,14 @@ import { handleApiResponse } from "@/utils/tryCatch";
type VerifyUserResponse =
| {
ok: boolean;
mismatch_fields: string[] | null;
error: string | null;
detail: string | null;
}
ok: boolean;
mismatch_fields: string[] | null;
error: string | null;
detail: string | null;
}
| {
message: boolean;
};
message: boolean;
};
export async function verifyUser(userId: string) {
const session = await getServerSession(authOptions);
if (!session?.apiToken) {
@ -230,6 +230,7 @@ export type AddTopupFormState = {
message: string;
fieldErrors?: {
amount?: string[];
description?: string[];
};
payload?: FormData;
};
@ -242,6 +243,15 @@ export async function adminUserTopup(
const amount = formData.get("amount") as string;
const session = await getServerSession(authOptions);
if (!amount) {
return {
status: false,
message: "Amount is required",
fieldErrors: { amount: ["Amount is required"], description: [] },
payload: formData,
}
}
const response = await fetch(
`${process.env.SARLINK_API_BASE_URL}/api/billing/admin-topup/`,
{