diff --git a/app/Models/Organization.php b/app/Models/Organization.php index fb720ce5..4ff676cd 100644 --- a/app/Models/Organization.php +++ b/app/Models/Organization.php @@ -51,6 +51,7 @@ class Organization extends Model implements HasMedia 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', + 'accepts_volunteers' => 'boolean' ]; protected $with = ['counties', 'activityDomains', 'projects', 'media']; diff --git a/resources/js/Components/form/FileInput.vue b/resources/js/Components/form/FileInput.vue index fc4f3da8..f935e105 100644 --- a/resources/js/Components/form/FileInput.vue +++ b/resources/js/Components/form/FileInput.vue @@ -1,39 +1,58 @@ diff --git a/resources/js/Components/form/Input.vue b/resources/js/Components/form/Input.vue index 0bb8bd62..35872bf2 100644 --- a/resources/js/Components/form/Input.vue +++ b/resources/js/Components/form/Input.vue @@ -34,7 +34,6 @@ const props = defineProps({ modelValue: { type: String, - required: true, }, error: { type: String, diff --git a/resources/js/Pages/AdminOng/Ong/EditOng.vue b/resources/js/Pages/AdminOng/Ong/EditOng.vue index ae867479..4bed682f 100644 --- a/resources/js/Pages/AdminOng/Ong/EditOng.vue +++ b/resources/js/Pages/AdminOng/Ong/EditOng.vue @@ -57,10 +57,12 @@ @cancel="form.cif = clonedOrganization.cif" class="flex justify-end col-span-1" > - @@ -79,15 +81,11 @@ @action="editField" :text="$t('change_image_label')" > - - - -
{{ $t('organization_accepts_volunteers_label') }}
{{ clonedOrganization.accepts_volunteers ? $t('yes') : $t('no') }}
+ {{ clonedOrganization.contact_email }} @@ -276,7 +275,7 @@
{{ clonedOrganization.contact_phone }}
@@ -323,13 +322,15 @@ @cancel="form.counties = clonedOrganization.counties; form.street_address = clonedOrganization.street_address" class="flex justify-end col-span-1" > -
- +
@@ -416,13 +417,11 @@ import Alert from '@/Components/Alert.vue'; import EditModal from '@/Components/modals/EditModal.vue'; import Input from '@/Components/form/Input.vue'; - import Select from '@/Components/form/Select.vue'; import Textarea from '@/Components/form/Textarea.vue'; import Checkbox from '@/Components/form/Checkbox.vue'; import FileInput from '@/Components/form/FileInput.vue'; import ModalAction from '@/Components/modals/ModalAction.vue'; - import MultiSelectObjectFilter from "@/Components/filters/MultiSelectObjectFilter.vue"; - import {onMounted} from "vue"; + import SelectMultiple from "@/Components/form/SelectMultiple.vue"; /** Page props. */ const props = defineProps({ @@ -434,24 +433,17 @@ /** Initialize inertia from Object. */ const form = useForm({ ...props.organization }); - const clonedOrganization = ({...props.organization}) + const clonedOrganization = ({...props.organization}); const editField = () => { - console.log(form); form.put(route('admin.ong.update', form.id), { preserveScroll: true, onSuccess: () => {}, onError: () => {}, }); } - const handleFileChange = (event) => { - const file = event.target.files[0]; - - if (file) { - const reader = new FileReader(); - reader.onload = (() => form.cover_image = reader.result); - reader.readAsDataURL(file); - } + + const handleFileChange = (file) => { form.cover_image = file; }