Merge branch 'dillon/63.7-company-with-multiple-employees' into development

This commit is contained in:
Dillon Ngo
2024-08-21 22:16:22 +08:00
5 changed files with 6 additions and 5 deletions
@@ -5,7 +5,7 @@ namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Auth;
class HasActiveRewardWithUser implements Filter
class HasActiveReward implements Filter
{
/**
@@ -7,7 +7,7 @@ use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Auth;
class HasActiveRewardWithCompany implements Filter
class HasVouchersAllWithCompany implements Filter
{
/**
+2 -1
View File
@@ -17,7 +17,8 @@ class VoucherResource extends JsonResource
public function toArray($request)
{
$filteredRedemptions = new ArrayObject([]);
if ($request->has('filters') && str_contains($request->input('filters'), "has_vouchers_all_with_user")) {
if ($request->has('filters') && (str_contains($request->input('filters'), "has_vouchers_all_with_user") )) {
//|| str_contains($request->input('filters'), "has_vouchers_all_with_company")
$filteredRedemptions = new ArrayObject([]);
}
else{
@@ -98,7 +98,7 @@
fetchVouchers(){
this.isLoading = true;
if(this.employee){
this.submit(route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all_with_user': this.employee.id} ), 'get', this.section, false, false);
this.submit(route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all_with_company': this.employee.id} ), 'get', this.section, false, false);
}
},
successHandler(response){
@@ -79,7 +79,7 @@
fetchVouchers(){
this.isLoading = true;
if(this.employee){
this.submit(route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all_with_user': this.employee.id} ), 'get', this.section, false, false);
this.submit(route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all_with_company': this.employee.id} ), 'get', this.section, false, false);
}
},
successHandler(response){