Skip to content

Commit

Permalink
#452 - bug fix (#472)
Browse files Browse the repository at this point in the history
* #452 - fix: fixed edit form

* #452 - fix: create view fix
  • Loading branch information
kamilpiech97 authored Jul 23, 2024
1 parent f65ff3b commit 18ce4be
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 50 deletions.
5 changes: 0 additions & 5 deletions app/Http/Resources/UserFormDataResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,8 @@ public function toArray($request): array
"role" => $this->role,
"position" => $this->profile->position,
"employmentForm" => $this->profile->employment_form,
"employmentDate" => $this->profile->employment_date->toDateString(),
"birthday" => $this->profile->birthday->toDateString(),
"slackId" => $this->profile->slack_id,
"lastMedicalExamDate" => $this->profile->last_medical_exam_date?->toDateString(),
"nextMedicalExamDate" => $this->profile->next_medical_exam_date?->toDateString(),
"lastOhsTrainingDate" => $this->profile->last_ohs_training_date?->toDateString(),
"nextOhsTrainingDate" => $this->profile->next_ohs_training_date?->toDateString(),
];
}
}
23 changes: 0 additions & 23 deletions resources/js/Pages/Users/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const form = useForm({
employmentForm: props.employmentForms[0],
role: props.roles[0],
position: null,
employmentDate: null,
birthday: null,
slackId: null,
})
Expand Down Expand Up @@ -245,28 +244,6 @@ function createUser() {
</p>
</div>
</Listbox>
<div class="items-center py-4 sm:grid sm:grid-cols-3">
<label
for="employment_date"
class="block text-sm font-medium text-gray-700 sm:mt-px"
>
Data zatrudnienia
</label>
<div class="mt-1 sm:col-span-2 sm:mt-0">
<FlatPickr
id="employment_date"
v-model="form.employmentDate"
class="block w-full max-w-lg rounded-md shadow-sm sm:text-sm"
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors.employmentDate, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.employmentDate }"
/>
<p
v-if="form.errors.employmentDate"
class="mt-2 text-sm text-red-600"
>
{{ form.errors.employmentDate }}
</p>
</div>
</div>
<div class="items-center py-4 sm:grid sm:grid-cols-3">
<label
for="slackId"
Expand Down
22 changes: 0 additions & 22 deletions resources/js/Pages/Users/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,28 +253,6 @@ function editUser() {
</p>
</div>
</Listbox>
<div class="items-center py-4 sm:grid sm:grid-cols-3">
<label
for="employment_date"
class="block text-sm font-medium text-gray-700 sm:mt-px"
>
Data zatrudnienia
</label>
<div class="mt-1 sm:col-span-2 sm:mt-0">
<FlatPickr
id="employment_date"
v-model="form.employmentDate"
class="block w-full max-w-lg rounded-md shadow-sm sm:text-sm"
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors.employmentDate, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.employmentDate }"
/>
<p
v-if="form.errors.employmentDate"
class="mt-2 text-sm text-red-600"
>
{{ form.errors.employmentDate }}
</p>
</div>
</div>
<div class="items-center py-4 sm:grid sm:grid-cols-3">
<label
for="birthday"
Expand Down

0 comments on commit 18ce4be

Please sign in to comment.