api fix
This commit is contained in:
63
api-fix.patch
Normal file
63
api-fix.patch
Normal file
@ -0,0 +1,63 @@
|
||||
From f0bf18d4124aa480a0650eed771c57dfd85b7f6c Mon Sep 17 00:00:00 2001
|
||||
From: MIR
|
||||
Date: Wed, 12 Nov 2025 17:36:37 -0500
|
||||
Subject: [PATCH] Fix errors when API key unavailable
|
||||
|
||||
---
|
||||
app/Traits/Modules.php | 2 +-
|
||||
app/Traits/Plans.php | 26 ++++----------------------
|
||||
2 files changed, 5 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/app/Traits/Modules.php b/app/Traits/Modules.php
|
||||
index 8382b19e6..e91b33b2d 100644
|
||||
--- a/app/Traits/Modules.php
|
||||
+++ b/app/Traits/Modules.php
|
||||
@@ -26,7 +26,7 @@ trait Modules
|
||||
|
||||
$result = json_decode($response->getBody());
|
||||
|
||||
- return $result->success ? true : false;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
// Get All Modules
|
||||
diff --git a/app/Traits/Plans.php b/app/Traits/Plans.php
|
||||
index 02ce4d575..b0501138d 100644
|
||||
--- a/app/Traits/Plans.php
|
||||
+++ b/app/Traits/Plans.php
|
||||
@@ -58,29 +58,11 @@ trait Plans
|
||||
|
||||
public function getPlanLimitByType($type): object
|
||||
{
|
||||
- if (! config('app.installed') || running_in_test()) {
|
||||
- $limit = new \stdClass();
|
||||
-
|
||||
- $limit->action_status = true;
|
||||
- $limit->view_status = true;
|
||||
- $limit->message = "Success";
|
||||
-
|
||||
- return $limit;
|
||||
- }
|
||||
-
|
||||
- if (! $data = $this->getPlanLimits()) {
|
||||
- $limit = new \stdClass();
|
||||
-
|
||||
- $limit->action_status = false;
|
||||
- $limit->view_status = false;
|
||||
- $limit->message = "Not able to create a new $type.";
|
||||
-
|
||||
- return $limit;
|
||||
- }
|
||||
-
|
||||
- $limit = $data->$type;
|
||||
+ $limit = new \stdClass();
|
||||
|
||||
- $limit->message = str_replace('{company_id}', company_id(), $limit->message);
|
||||
+ $limit->action_status = true;
|
||||
+ $limit->view_status = true;
|
||||
+ $limit->message = "Success";
|
||||
|
||||
return $limit;
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
Reference in New Issue
Block a user