mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 00:43:58 +00:00
Fix some breaking changes that is already deployed to master branch
This commit is contained in:
@@ -59,7 +59,7 @@ class UpdateBankMetadataLogic extends AbstractControllerLogic
|
||||
$this->canUpdateBankMetadata->passes($bankMetadataObject);
|
||||
|
||||
$transaction = $this->fetchesTransaction->execute(['id' => $request->input('transactionId')]);
|
||||
$transaction->attributes()->delete();
|
||||
$transaction->attributesKVP()->delete();
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class UpdateBankProcessor
|
||||
|
||||
// if ($result->wasRecentlyCreated) {
|
||||
//Key #1 for Bank
|
||||
$kvp = $bank->attributes()->where('key', 'App\Models\Bank')->where('value', $result->id)->latest()->first();
|
||||
$kvp = $bank->attributesKVP()->where('key', 'App\Models\Bank')->where('value', $result->id)->latest()->first();
|
||||
if(!$kvp){
|
||||
$keyValuePairObject = new KeyValuePairObject(
|
||||
"App\Models\Bank",
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ class Bank extends AbstractModel implements KeyValueInterface
|
||||
/**
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function attributes(): MorphMany
|
||||
public function attributesKVP(): MorphMany
|
||||
{
|
||||
return $this->morphMany(KeyValuePair::class, 'owner');
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ class Transaction extends AbstractModel implements Documentable, Transactionable
|
||||
/**
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function attributes(): MorphMany
|
||||
public function attributesKVP(): MorphMany
|
||||
{
|
||||
return $this->morphMany(KeyValuePair::class, 'owner');
|
||||
}
|
||||
@@ -283,7 +283,7 @@ class Transaction extends AbstractModel implements Documentable, Transactionable
|
||||
*/
|
||||
public function getBankAttribute()
|
||||
{
|
||||
$keyValuePairs = $this->attributes()->where('key', 'App\Models\Bank')->latest()->first();
|
||||
$keyValuePairs = $this->attributesKVP()->where('key', 'App\Models\Bank')->latest()->first();
|
||||
if($keyValuePairs){
|
||||
$bank = Bank::where('id', $keyValuePairs->value)->first();
|
||||
return $bank;
|
||||
|
||||
Reference in New Issue
Block a user