Fix delete function and type

This commit is contained in:
QiTao Weng 2022-04-10 05:12:33 -05:00
parent 94e9a09aea
commit 3d22ee9cfa
2 changed files with 4 additions and 13 deletions

View File

@ -110,11 +110,11 @@ onMounted(() => {
</q-card-actions> </q-card-actions>
<q-card-section class="text-center q-pa-none"> <q-card-section class="text-center q-pa-none">
<p class="text-grey-6"> <p class="text-grey-6">
{{ isRegistration ? 'Have an account?' : 'Not reigistered?' }} {{ isRegistration ? 'Have an account?' : 'Not registered?' }}
<a <a
href="#" href="#"
@click="isRegistration = !isRegistration; checkForm()" @click="isRegistration = !isRegistration; checkForm()"
>{{ isRegistration ? 'Login' : 'Created an Account' }}</a> >{{ isRegistration ? 'Login' : 'Create an Account' }}</a>
</p> </p>
</q-card-section> </q-card-section>
</template> </template>

View File

@ -385,16 +385,7 @@ const deleteEditorPage = async (close = false) => {
}, },
body: JSON.stringify(params), body: JSON.stringify(params),
}) })
await router.push('/Listings')
const result = (await response.json()) as unknown as any
if (!result.success) {
return alert('Failed to delete page: ' + result.message)
}
editorPageId.value = result.data.pageId
if ( close ) {
await router.push('/Listings')
}
} }
const loadEditorPage = async () => { const loadEditorPage = async () => {
@ -597,7 +588,7 @@ onMounted(() => {
<q-btn fab icon="close" title="Save and close" color="primary" @click="() => saveEditorPage(true)"/> <q-btn fab icon="close" title="Save and close" color="primary" @click="() => saveEditorPage(true)"/>
</q-page-sticky> </q-page-sticky>
<q-page-sticky position="top-right" :offset="[18, 162]"> <q-page-sticky position="top-right" :offset="[18, 162]">
<q-btn fab icon="delete_forever" title="Delete forever" color="primary" @click=""/> <q-btn fab icon="delete_forever" title="Delete forever" color="primary" @click="() => deleteEditorPage()"/>
</q-page-sticky> </q-page-sticky>
<q-page-sticky position="bottom-right" :offset="[32, 32]"> <q-page-sticky position="bottom-right" :offset="[32, 32]">