feat: add base salary default value to employee edit form
This commit is contained in:
parent
16487dadf5
commit
78c432eaa0
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Requests\Admin\HR;
|
||||
|
||||
use App\Concerns\CurrencyStripping;
|
||||
use App\Enums\EmploymentStatus;
|
||||
use App\Enums\Gender;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
@ -9,12 +10,19 @@
|
||||
|
||||
class EmployeeRequest extends FormRequest
|
||||
{
|
||||
use CurrencyStripping;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()->can('employees.create')
|
||||
|| $this->user()->can('employees.update');
|
||||
}
|
||||
|
||||
public function prepareForValidation(): void
|
||||
{
|
||||
$this->merge($this->stripCurrencyDot($this->all(), 'base_salary'));
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
$userId = $this->route('user')?->id;
|
||||
|
||||
@ -401,6 +401,10 @@ export default function EmployeeEdit({ employee, roles, canViewAll }: Props) {
|
||||
</Label>
|
||||
<RupiahInput
|
||||
name="base_salary"
|
||||
defaultValue={
|
||||
employee.employee
|
||||
?.base_salary ?? 0
|
||||
}
|
||||
/>
|
||||
<InputError
|
||||
message={
|
||||
|
||||
Loading…
Reference in New Issue
Block a user