update message and formatting

This commit is contained in:
Mohit Panjwani
2022-03-03 17:02:38 +05:30
parent a23644c9d8
commit 9a0de9f64f
2 changed files with 2 additions and 8 deletions

View File

@ -20,14 +20,8 @@ class CompanyCurrencyCheckTransactionsController extends Controller
$this->authorize('manage company', $company); $this->authorize('manage company', $company);
if ($company->hasTransactions()) {
return response()->json([
'success' => false,
]);
}
return response()->json([ return response()->json([
'success' => true, 'has_transactions' => $company->hasTransactions(),
]); ]);
} }
} }

View File

@ -26,7 +26,7 @@ class UpdateCompanySettingsController extends Controller
if ($companyCurrency !== $data['currency'] && $company->hasTransactions()) { if ($companyCurrency !== $data['currency'] && $company->hasTransactions()) {
return response()->json([ return response()->json([
'success' => false, 'success' => false,
'message' => 'You cannot change currency once transaction is created.' 'message' => 'Cannot update company currency after transactions are created.'
]); ]);
} }