Fix some tests for account API

This commit is contained in:
James Cole
2021-03-13 12:01:01 +01:00
parent 668b169a5e
commit 7118abe28d
29 changed files with 992 additions and 315 deletions

View File

@@ -185,14 +185,14 @@ class BillUpdateService
if ($newOrder > $oldOrder) {
$this->user->bills()->where('order', '<=', $newOrder)->where('order', '>', $oldOrder)
->where('bills.id', '!=', $bill->id)
->update(['order' => DB::raw('bills.order-1')]);
->decrement('bills.order',1);
$bill->order = $newOrder;
$bill->save();
}
if ($newOrder < $oldOrder) {
$this->user->bills()->where('order', '>=', $newOrder)->where('order', '<', $oldOrder)
->where('bills.id', '!=', $bill->id)
->update(['order' => DB::raw('bills.order+1')]);
->increment('bills.order',1);
$bill->order = $newOrder;
$bill->save();
}