mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Check expense category name is unique
This commit is contained in:
parent
5f8ae65310
commit
3498d28d3f
@ -21,7 +21,7 @@ class CreateExpenseCategoryRequest extends ExpenseCategoryRequest
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'name' => sprintf('required|unique:expense_categories,name,,id,account_id,%s', $this->user()->account_id),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ class UpdateExpenseCategoryRequest extends ExpenseCategoryRequest
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'name' => sprintf('required|unique:expense_categories,name,%s,id,account_id,%s', $this->entity()->id, $this->user()->account_id),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user