fixed profile

This commit is contained in:
2025-09-06 14:55:02 -04:00
parent e74f5510f0
commit 6978ed30e1
3 changed files with 16 additions and 4 deletions

View File

@@ -154,6 +154,9 @@
</div>
</div>
</div>
<Footer />
</template>
@@ -343,7 +346,7 @@ export default defineComponent({
})
.then((response: any) => {
if (response.data.ok) {
this.$router.push({ name: "customerProfile", params: { id: this.customer.id } });
this.$router.push({ name: "customerProfile", params: { id: this.customer.id }, query: { success: 'true' } });
} else if (response.data.error) {
// Handle specific errors if needed
this.$router.push("/");

View File

@@ -48,10 +48,11 @@
<p class="text-gray-400">Location not available...</p>
</div>
<ProfileSummary
<ProfileSummary
class="xl:col-span-5"
:customer="customer"
:customer="customer"
:automatic_status="automatic_status"
:customer_description="customer_description.description"
@toggle-automatic="userAutomatic"
/>
</div>
@@ -271,7 +272,12 @@ export default defineComponent({
this.getCustomer(this.$route.params.id);
},
mounted() {
// getPage is now called from within getCustomer, so this can be removed if it's redundant
// Check for success query parameter and show notification
if (this.$route.query.success === 'true') {
this.$notify({ title: "Success", text: "Customer edited successfully!", type: "success" });
// Clean up the URL by removing the query parameter
this.$router.replace({ name: this.$route.name, params: this.$route.params, query: {} });
}
},
watch: {
'$route.params.id'(newId) {

View File

@@ -67,6 +67,8 @@
<p>{{ customer.customer_town }}, {{ stateName(customer.customer_state) }} {{ customer.customer_zip }}</p>
<p class="pt-2">{{ customer.customer_phone_number }}</p>
<p><span class="badge badge-outline badge-sm">{{ homeTypeName(customer.customer_home_type) }}</span></p>
<hr class="my-2" v-if="customer_description">
<p v-if="customer_description" class="text-sm">{{ customer_description }}</p>
</div>
</div>
</div>
@@ -91,6 +93,7 @@ interface Customer {
interface Props {
customer: Customer;
automatic_status: number;
customer_description?: string;
}
defineProps<Props>();