<template> <BaseLayout> <div class="pb-6"> <BaseContainer> <div class=" w-full py-3">…
- Usercode
<BaseLayout> <div class="pb-6"> <BaseContainer> <div class=" w-full py-3"> <div class="aspect-[1.376] h-10 bg-mid_gray mb-2 m-auto">Logo</div> </div> <h1 class="text-sm text-secondary font-bold my-2 text-center w-full">Trust. Verify. Succeed</h1> <div class="my-8 grid grid-cols-3 lg:py-10 lg:px-40"> <ProcessItem label="Job Request" /> <ProcessItem label="Verification of Basic Information" /> <ProcessItem label="Review and Report Writing" /> </div> <div class="flex justify-center"> <router-link to ="/steps"> <Button type="submit" :class="['bg-secondary hover:bg-secondary_hover px-4 py-2 text-white']" > Fill the Form Now <span class="mx-2">-></span> </Button> </router-link> <Button @click="updateDocumentData" type="submit" :class="['bg-secondary hover:bg-secondary_hover px-4 py-2 text-white']" > Test<span class="mx-2">-></span> </Button> </div> <!-- <div class="gap-3 w-full flex flex-col justify-center items-center"> <span class="text-primary font-bold text-lg block" >Thanks for your information</span> <span class="text-sm font-medium block" >Thanks for your information</span> <span class="text-xs font-medium block" >Your order ID: GA-06564-gh71</span> <Button class="w-fit" type="submit" ><i class="inline-block w-4 h-4 rounded-full bg-mid_gray" /> Rate</Button> </div> --> </BaseContainer> </div> <!-- <JobRequest /> <Review /> <Verification /> --> <Contact :location="location"/> </BaseLayout> <!-- <button class="fixed z-30 bottom-0 bg-red-700 rounded-xl text-white p-2 " @click="triggerAlert('Your Contact details has been saved!')">زر تجربة الالرت</button> --> - Assistant
- User
home.vue:123 Document name is not available for update
- Assistant
- User
اعد كتابة الكود كامل
- Assistant
- User
const documentName = ref('');
const requestList = createDocumentResource({ doctype: 'Verification Instructions Request', name: documentName.value, onSuccess(data) { console.log('Document fetched successfully:', data); }, onError(error) { console.error('Error fetching document:', error); }, });
async function fetchDocument() { try { await requestList.get(); if (requestList.doc) { documentName.value = requestList.doc.name || 'No Name Available'; console.log("Fetched Document Name:", documentName.value); } else { console.warn('Document is not available after fetching'); } } catch (error) { console.error('Error while fetching document:', error); } }
onMounted(() => { fetchDocument(); });
watch(() => documentName.value, (newName) => { console.log("Current Document Name:", newName); });
function updateDocumentData() { if (documentName.value && documentName.value !== 'No Name Available') { requestList.setValue.submit({ first_name: 'Asofi', // Add other fields as necessary }) .then(response => { console.log('Data updated successfully:', response); }) .catch(error => { console.error('Update Error:', error); }); } else { console.warn("Document name is not available for update"); } }
- Assistant
- User
home.vue:95 Error while fetching document: TypeError: Cannot read properties of undefined (reading 'get') at fetchDocument (home.vue:87:23) at home.vue:100:3 at chunk-4G2AIOYC.js?v=0573fe2c:4317:40 at callWithErrorHandling (chunk-4G2AIOYC.js?v=0573fe2c:2152:19) at callWithAsyncErrorHandling (chunk-4G2AIOYC.js?v=0573fe2c:2159:17) at hook.__weh.hook.__weh (chunk-4G2AIOYC.js?v=0573fe2c:4299:19) at flushPostFlushCbs (chunk-4G2AIOYC.js?v=0573fe2c:2334:9) at flushJobs (chunk-4G2AIOYC.js?v=0573fe2c:2372:5)
- Assistant