Compare commits
No commits in common. "547c9edfd548b9d9ee02f081e5cab6b1b433392e" and "9d37ebefc5b014e90ef853683b09a309d6c38d77" have entirely different histories.
547c9edfd5
...
9d37ebefc5
|
@ -1,9 +1,5 @@
|
||||||
# Letzte Änderungen
|
# Letzte Änderungen
|
||||||
|
|
||||||
### 1.10.18
|
|
||||||
|
|
||||||
- Fixed: All Gruppen als Option anbieten bei Bedingungen
|
|
||||||
|
|
||||||
### 1.10.17
|
### 1.10.17
|
||||||
|
|
||||||
- Es können nun auch Bedingungen für Felder vom Typ Gruppierung definiert werden
|
- Es können nun auch Bedingungen für Felder vom Typ Gruppierung definiert werden
|
||||||
|
|
|
@ -6,7 +6,6 @@ use App\Group;
|
||||||
use App\Group\Resources\GroupResource;
|
use App\Group\Resources\GroupResource;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
|
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
|
||||||
use Lorisleiva\Actions\ActionRequest;
|
|
||||||
use Lorisleiva\Actions\Concerns\AsAction;
|
use Lorisleiva\Actions\Concerns\AsAction;
|
||||||
|
|
||||||
class GroupApiIndexAction
|
class GroupApiIndexAction
|
||||||
|
@ -21,12 +20,8 @@ class GroupApiIndexAction
|
||||||
return Group::get();
|
return Group::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function asController(ActionRequest $request, ?Group $group = null): AnonymousResourceCollection
|
public function asController(?Group $group = null): AnonymousResourceCollection
|
||||||
{
|
{
|
||||||
return GroupResource::collection(
|
return GroupResource::collection($group ? $group->children()->withCount('children')->get() : Group::where('parent_id', null)->withCount('children')->get());
|
||||||
$request->has('all')
|
|
||||||
? Group::with('children')->get()
|
|
||||||
: ($group ? $group->children()->withCount('children')->get() : Group::where('parent_id', null)->withCount('children')->get())
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,6 +176,6 @@ if (props.single.links && props.single.links.is_dirty) {
|
||||||
const groupOptions = ref([]);
|
const groupOptions = ref([]);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
groupOptions.value = (await axios.get('/api/group?all')).data.data;
|
groupOptions.value = (await axios.get('/api/group')).data.data;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue