mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
- Added loading state management in the EnablePaidFeatures component to improve user experience during license validation. - Updated validateLicense function to return detailed error messages for better feedback. - Modified user API to return validation results instead of a boolean, enhancing error handling. - Removed unused SQL files and updated package.json scripts for better development workflow.
19 lines
506 B
TypeScript
19 lines
506 B
TypeScript
const licensesUrl = process.env.LICENSES_URL || "http://localhost:4002";
|
|
|
|
export const validateLicense = async (licenseKey: string, serverIp: string) => {
|
|
const response = await fetch(`${licensesUrl}/api/validate`, {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: JSON.stringify({ licenseKey, serverIp }),
|
|
});
|
|
const data = await response.json();
|
|
|
|
if (!response.ok && data.error?.issues) {
|
|
console.log("Validation errors:", data.error.issues);
|
|
}
|
|
|
|
return data;
|
|
};
|