Skip to content

Commit

Permalink
Fix Postgres issue on create customer page (#1907)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson authored Aug 15, 2024
1 parent 69ca552 commit c343ac3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/admin/src/Filament/Resources/CustomerResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ protected static function getCustomerGroupsFormComponent(): Component
{
return Forms\Components\CheckboxList::make('customerGroups')
->label(__('lunarpanel::customer.form.customer_groups.label'))
->relationship(name: 'customerGroups', titleAttribute: 'name');
->relationship(
name: 'customerGroups',
titleAttribute: 'name',
modifyQueryUsing: fn (Builder $query) => $query->distinct(
['id', 'name', 'handle', 'default']
)
);
}

protected static function getDefaultTable(Table $table): Table
Expand Down

0 comments on commit c343ac3

Please sign in to comment.