Skip to content

Commit 569b33b

Browse files
committed
Update profile is easier if the full profile is given
1 parent 360965b commit 569b33b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

stubs/inertia/resources/js/Pages/Profile/Show.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
<div>
1010
<div class="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">
1111
<update-profile-information-form
12-
:name="$page.user.name"
13-
:email="$page.user.email" />
12+
:user="$page.user" />
1413

1514
<jet-section-border />
1615

stubs/inertia/resources/js/Pages/Profile/UpdateProfileInformationForm.vue

+7-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<!-- Current Profile Photo -->
2222
<div class="mt-2" v-show="! photoPreview">
23-
<img :src="$page.user.profile_photo_url" alt="Current Profile Photo" class="rounded-full h-20 w-20 object-cover">
23+
<img :src="user.profile_photo_url" alt="Current Profile Photo" class="rounded-full h-20 w-20 object-cover">
2424
</div>
2525

2626
<!-- New Profile Photo Preview -->
@@ -34,7 +34,7 @@
3434
Select A New Photo
3535
</jet-secondary-button>
3636

37-
<jet-secondary-button type="button" class="mt-2" @click.native.prevent="deletePhoto" v-if="$page.user.profile_photo_path">
37+
<jet-secondary-button type="button" class="mt-2" @click.native.prevent="deletePhoto" v-if="user.profile_photo_path">
3838
Remove Photo
3939
</jet-secondary-button>
4040

@@ -88,14 +88,16 @@
8888
JetSecondaryButton,
8989
},
9090
91-
props: ['name', 'email'],
91+
props: {
92+
user: Object,
93+
},
9294
9395
data() {
9496
return {
9597
form: this.$inertia.form({
9698
'_method': 'PUT',
97-
name: this.name,
98-
email: this.email,
99+
name: this.user.name,
100+
email: this.user.email,
99101
photo: null,
100102
}, {
101103
bag: 'updateProfileInformation',

0 commit comments

Comments
 (0)