handling create update delete categories
This commit is contained in:
@@ -36,7 +36,6 @@ const recurrentDate = ref<number>(Math.floor(Math.random() * 31))
|
||||
const isDateError = ref(false)
|
||||
|
||||
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
if (spaceStore.selectedSpaceId) {
|
||||
@@ -172,7 +171,11 @@ const deleteAlertMessage = ref('Do you want to delete recurrent?')
|
||||
const deleteRecurrent = async () => {
|
||||
await recurrentsService.deleteRecurrent(spaceStore.selectedSpaceId, recurrentId.value)
|
||||
await recurrentsStore.fetchRecurrents(spaceStore.selectedSpaceId)
|
||||
router.back()
|
||||
if (window.history.length > 1) {
|
||||
router.back()
|
||||
} else {
|
||||
await router.push('/categories')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -190,7 +193,7 @@ onMounted(async () => {
|
||||
console.log('deleteRecurrent2')
|
||||
if (tgApp.initData) {
|
||||
console.log('deleteRecurrent3')
|
||||
tgApp.showConfirm(deleteAlertMessage.value, async (confirmed) => {
|
||||
tgApp.showConfirm(deleteAlertMessage.value, async (confirmed: boolean) => {
|
||||
if (confirmed) {
|
||||
console.log("recurrent id is deleted")
|
||||
await deleteRecurrent()
|
||||
|
||||
Reference in New Issue
Block a user