Compare commits
2 Commits
863d0e7b98
...
78c432eaa0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78c432eaa0 | ||
|
|
16487dadf5 |
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Admin\HR;
|
namespace App\Http\Requests\Admin\HR;
|
||||||
|
|
||||||
|
use App\Concerns\CurrencyStripping;
|
||||||
use App\Enums\EmploymentStatus;
|
use App\Enums\EmploymentStatus;
|
||||||
use App\Enums\Gender;
|
use App\Enums\Gender;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
@ -9,12 +10,19 @@
|
|||||||
|
|
||||||
class EmployeeRequest extends FormRequest
|
class EmployeeRequest extends FormRequest
|
||||||
{
|
{
|
||||||
|
use CurrencyStripping;
|
||||||
|
|
||||||
public function authorize(): bool
|
public function authorize(): bool
|
||||||
{
|
{
|
||||||
return $this->user()->can('employees.create')
|
return $this->user()->can('employees.create')
|
||||||
|| $this->user()->can('employees.update');
|
|| $this->user()->can('employees.update');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function prepareForValidation(): void
|
||||||
|
{
|
||||||
|
$this->merge($this->stripCurrencyDot($this->all(), 'base_salary'));
|
||||||
|
}
|
||||||
|
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
$userId = $this->route('user')?->id;
|
$userId = $this->route('user')?->id;
|
||||||
|
|||||||
@ -401,6 +401,10 @@ export default function EmployeeEdit({ employee, roles, canViewAll }: Props) {
|
|||||||
</Label>
|
</Label>
|
||||||
<RupiahInput
|
<RupiahInput
|
||||||
name="base_salary"
|
name="base_salary"
|
||||||
|
defaultValue={
|
||||||
|
employee.employee
|
||||||
|
?.base_salary ?? 0
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<InputError
|
<InputError
|
||||||
message={
|
message={
|
||||||
|
|||||||
@ -60,15 +60,6 @@ export default function Login() {
|
|||||||
<InputError message={errors.password} />
|
<InputError message={errors.password} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center space-x-3">
|
|
||||||
<Checkbox
|
|
||||||
id="remember"
|
|
||||||
name="remember"
|
|
||||||
tabIndex={3}
|
|
||||||
/>
|
|
||||||
<Label htmlFor="remember">Ingat saya</Label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="mt-4 w-full"
|
className="mt-4 w-full"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user