Skip to content

A self-hosted media server and file management system

clean up

aminnausinc41732609a7e
diff --git a/package-lock.json b/package-lock.json
index ec24bd9d..7d54281e 100755
--- a/package-lock.json
+++ b/package-lock.json
@@ -21,8 +21,7 @@
"vue": "^3.4.29",
"vue-chartjs": "^5.3.2",
"vue-loader": "^17.4.2",
- "vue-router": "^4.4.0",
- "vue-sonner": "^1.3.0"
+ "vue-router": "^4.4.0"
},
"devDependencies": {
"@7nohe/laravel-typegen": "^0.6.1",
@@ -5743,12 +5742,6 @@
"vue": "^3.2.0"
}
},
- "node_modules/vue-sonner": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/vue-sonner/-/vue-sonner-1.3.0.tgz",
- "integrity": "sha512-jAodBy4Mri8rQjVZGQAPs4ZYymc1ywPiwfa81qU0fFl+Suk7U8NaOxIDdI1oBGLeQJqRZi/oxNIuhCLqsBmOwg==",
- "license": "MIT"
- },
"node_modules/vue-tsc": {
"version": "2.1.10",
"resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.1.10.tgz",
diff --git a/package.json b/package.json
index a5dc7e4e..7d5fe579 100755
--- a/package.json
+++ b/package.json
@@ -70,7 +70,6 @@
"vue": "^3.4.29",
"vue-chartjs": "^5.3.2",
"vue-loader": "^17.4.2",
- "vue-router": "^4.4.0",
- "vue-sonner": "^1.3.0"
+ "vue-router": "^4.4.0"
}
}
diff --git a/resources/js/App.vue b/resources/js/App.vue
index ac589cce..522f7b28 100755
--- a/resources/js/App.vue
+++ b/resources/js/App.vue
@@ -6,7 +6,6 @@ import { getScreenSize } from './service/util';
import { storeToRefs } from 'pinia';
import { useAppStore } from '@/stores/AppStore';
import { RouterView } from 'vue-router';
-import { Toaster } from 'vue-sonner';
import ToastController from '@/components/pinesUI/ToastController.vue';
@@ -35,6 +34,5 @@ watch(playbackHeatmap, setPlaybackHeatmap, { immediate: false });
<template>
<ToastController v-if="toastPosition" :position="toastPosition" />
- <Toaster />
<RouterView />
</template>
diff --git a/resources/js/app.ts b/resources/js/app.ts
index 09af4e85..e3a4c661 100644
--- a/resources/js/app.ts
+++ b/resources/js/app.ts
@@ -6,13 +6,13 @@ import { createApp } from 'vue';
import router from './router';
import App from './App.vue';
-import toastService from './service/toaster/toastService.ts';
+// import toastService from './service/toaster/toastService.ts';
const application = createApp(App);
const pinia = createPinia();
application.use(router);
application.use(pinia);
-application.use(toastService);
+// application.use(toastService);
application.use(VueQueryPlugin);
application.mount('#app');
diff --git a/resources/js/components/cards/VideoCard.vue b/resources/js/components/cards/VideoCard.vue
index faa3e8ac..b4de708d 100755
--- a/resources/js/components/cards/VideoCard.vue
+++ b/resources/js/components/cards/VideoCard.vue
@@ -73,7 +73,7 @@ watch(props, handlePropsUpdate, { immediate: true });
class="z-30 left-20 bottom-10 absolute opacity-0 group-hover:opacity-100 transition-opacity ease-in-out duration-500 w-1/2"
>
<div
- class="p-3 shadow rounded-md ring-inset dark:bg-primary-dark-800 bg-gray-100 odd:bg-violet-100 dark:odd:bg-primary-dark-600"
+ class="p-3 bg-gray-100 odd:bg-violet-100 dark:odd:bg-primary-dark-600/70 dark:bg-neutral-800/70 backdrop-blur-lg border dark:border-none rounded-md shadow-md border-neutral-200/70"
>
{{ metaData?.fields?.description }}
</div>
diff --git a/resources/js/components/dashboard/DashboardAnalytics.vue b/resources/js/components/dashboard/DashboardAnalytics.vue
index 7ef20f79..9917a844 100644
--- a/resources/js/components/dashboard/DashboardAnalytics.vue
+++ b/resources/js/components/dashboard/DashboardAnalytics.vue
@@ -14,7 +14,7 @@ import ButtonText from '@/components/inputs/ButtonText.vue';
import LucideChartNoAxesCombined from '~icons/lucide/chart-no-axes-combined';
import ProiconsArrowSync from '~icons/proicons/arrow-sync';
-import { toast } from '@/service/toaster/state';
+import { toast } from '@/service/toaster/toastService';
const validPeriods: { key: string; value: string }[] = [
{ key: '1h', value: '1_hour' },
diff --git a/resources/js/components/dashboard/DashboardLibraries.vue b/resources/js/components/dashboard/DashboardLibraries.vue
index 348e5591..1fc63b09 100644
--- a/resources/js/components/dashboard/DashboardLibraries.vue
+++ b/resources/js/components/dashboard/DashboardLibraries.vue
@@ -1,7 +1,6 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
import { getCategories } from '@/service/mediaAPI';
-import { useToast } from '@/composables/useToast';
import RecordCardDetails from '@/components/cards/RecordCardDetails.vue';
import ButtonText from '@/components/inputs/ButtonText.vue';
@@ -10,7 +9,6 @@ import ModalBase from '@/components/pinesUI/ModalBase.vue';
import TableBase from '@/components/table/TableBase.vue';
import useModal from '@/composables/useModal';
-const toast = useToast();
const loading = ref(false);
const cachedID = ref<null | number>(null);
const confirmModal = useModal({ title: 'Delete Category?', submitText: 'Confim' });
diff --git a/resources/js/components/forms/EditFolder.vue b/resources/js/components/forms/EditFolder.vue
index a70c5ce8..6346e637 100644
--- a/resources/js/components/forms/EditFolder.vue
+++ b/resources/js/components/forms/EditFolder.vue
@@ -1,7 +1,7 @@
<script setup>
import { toCalendarFormattedDate } from '@/service/util';
import { reactive } from 'vue';
-import { useToast } from '@/composables/useToast';
+import { toast } from '@/service/toaster/toastService';
import FormInputNumber from '@/components/inputs/FormInputNumber.vue';
import FormInputLabel from '@/components/labels/FormInputLabel.vue';
@@ -14,8 +14,6 @@ import useForm from '@/composables/useForm';
const emit = defineEmits(['handleFinish']);
const props = defineProps(['folder']);
-const toast = useToast();
-
// 'title', 'description', 'studio', 'seasons', 'episodes', 'films', 'date_start', 'date_end', 'thumbnail_url', 'editor_id';
const fields = reactive([
{
@@ -120,10 +118,10 @@ const handleSubmit = async () => {
{
onSuccess: (response) => {
emit('handleFinish', response?.data);
- toast.add({ type: 'success', title: 'Success', description: 'Edit submitted!', life: 3000 });
+ toast.add('Success', { type: 'success', description: 'Edit submitted!', life: 3000 });
},
onError: () => {
- toast.add({ type: 'danger', title: 'Error', description: 'Unable to update video details.', life: 3000 });
+ toast.add('Error', { type: 'danger', description: 'Unable to update video details.', life: 3000 });
},
},
);
diff --git a/resources/js/components/forms/EditVideo.vue b/resources/js/components/forms/EditVideo.vue
index e32f3147..d273c65a 100755
--- a/resources/js/components/forms/EditVideo.vue
+++ b/resources/js/components/forms/EditVideo.vue
@@ -1,25 +1,24 @@
<script setup>
-import { toCalendarFormattedDate } from '../../service/util';
+import { toCalendarFormattedDate } from '@/service/util';
import { reactive, ref, watch } from 'vue';
import { useGetVideoTags } from '@/service/queries';
-import { UseCreateTag } from '../../service/mutations';
-import { useToast } from '../../composables/useToast';
+import { UseCreateTag } from '@/service/mutations';
-import FormInputNumber from '../inputs/FormInputNumber.vue';
-import InputMultiChip from '../pinesUI/InputMultiChip.vue';
-import FormInputLabel from '../labels/FormInputLabel.vue';
-import FormTextArea from '../inputs/FormTextArea.vue';
-import DatePicker from '../pinesUI/DatePicker.vue';
-import FormInput from '../inputs/FormInput.vue';
+import FormInputNumber from '@/components/inputs/FormInputNumber.vue';
+import InputMultiChip from '@/components/pinesUI/InputMultiChip.vue';
+import FormInputLabel from '@/components/labels/FormInputLabel.vue';
+import FormTextArea from '@/components/inputs/FormTextArea.vue';
+import DatePicker from '@/components/pinesUI/DatePicker.vue';
+import FormInput from '@/components/inputs/FormInput.vue';
import mediaAPI from '@/service/mediaAPI.ts';
-import useForm from '../../composables/useForm';
+import useForm from '@/composables/useForm';
+import { toast } from '@/service/toaster/toastService';
const emit = defineEmits(['handleFinish']);
const props = defineProps(['video']);
const { data: tagsQuery } = useGetVideoTags();
const createTag = UseCreateTag();
-const toast = useToast();
const allTags = ref([]);
const fields = reactive([
@@ -94,10 +93,10 @@ const handleSubmit = async () => {
{
onSuccess: (response) => {
emit('handleFinish', response?.data);
- toast.add({ type: 'success', title: 'Success', description: 'Edit submitted!', life: 3000 });
+ toast.add('Success', { type: 'success', description: 'Edit submitted!', life: 3000 });
},
onError: () => {
- toast.add({ type: 'danger', title: 'Error', description: 'Unable to update video details.', life: 3000 });
+ toast.add('Error', { type: 'danger', description: 'Unable to update video details.', life: 3000 });
},
},
);
@@ -107,13 +106,13 @@ const handleCreateTag = async (name) => {
try {
const { data: response } = await createTag.mutateAsync({ name });
- toast.add({ type: 'success', title: 'Success', description: 'Tag created!', life: 3000 });
+ toast.add('Success', { type: 'success', description: 'Tag created!', life: 3000 });
form.fields['video_tags'] = [...form.fields['video_tags'], { id: response.id, name: response.name }];
allTags.value = [...allTags.value, response];
} catch (error) {
console.log(error);
- toast.add({ type: 'error', title: 'Error', description: 'Unable to create tag. It may already exist.', life: 3000 });
+ toast.add('Error', { type: 'error', description: 'Unable to create tag. It may already exist.', life: 3000 });
}
};
diff --git a/resources/js/components/pinesUI/ToastController.vue b/resources/js/components/pinesUI/ToastController.vue
index 4fbb0ba9..15874282 100755
--- a/resources/js/components/pinesUI/ToastController.vue
+++ b/resources/js/components/pinesUI/ToastController.vue
@@ -3,7 +3,7 @@
import { type Message, type ToastControllerProps, type ToastLayout, type ToastPostion, type ToastToDismiss } from '@/types/pinesTypes';
import { nextTick, onMounted, ref, watch, watchEffect } from 'vue';
-import { ToastState } from '@/service/toaster/state';
+import { ToastState } from '@/service/toaster/toastService';
import ToastNotification from '@/components/pinesUI/ToastNotification.vue';
diff --git a/resources/js/composables/useClipboard.js b/resources/js/composables/useClipboard.js
index fe370e6b..62dfb17b 100755
--- a/resources/js/composables/useClipboard.js
+++ b/resources/js/composables/useClipboard.js
@@ -1,8 +1,7 @@
+import { toast } from '@/service/toaster/toastService';
import { reactive } from 'vue';
-import { useToast } from '../composables/useToast';
export default function useClipboard(copyText) {
- const toast = useToast();
return reactive({
copyText,
copyNotification: false,
@@ -15,9 +14,8 @@ export default function useClipboard(copyText) {
}, 3000);
} catch (error) {
console.log(error);
- toast.add({
+ toast.add('Error', {
type: 'danger',
- title: 'Error',
description: 'Unable to copy. Network is not secure.',
life: 3000,
});
diff --git a/resources/js/router/index.js b/resources/js/router/index.js
index 895bfa44..b3caba84 100755
--- a/resources/js/router/index.js
+++ b/resources/js/router/index.js
@@ -1,17 +1,17 @@
+import { createRouter, createWebHistory } from 'vue-router';
+import { useAuthStore } from '@/stores/AuthStore';
+import { toTitleCase } from '@/service/util';
+import { logout } from '@/service/authAPI';
+
+import DashboardView from '@/views/DashboardView.vue';
+import RegisterView from '@/views/RegisterView.vue';
import SettingsView from '@/views/SettingsView.vue';
import HistoryView from '@/views/HistoryView.vue';
import ProfileView from '@/views/ProfileView.vue';
-import RegisterView from '@/views/RegisterView.vue';
import LoginView from '@/views/LoginView.vue';
import VideoView from '@/views/VideoView.vue';
import ErrorView from '@/views/ErrorView.vue';
-
-import { createRouter, createWebHistory } from 'vue-router';
-import { useAuthStore } from '@/stores/AuthStore';
-import { logout } from '@/service/authAPI';
-import { toTitleCase } from '@/service/util';
-import { useToast } from '@/composables/useToast';
-import DashboardView from '@/views/DashboardView.vue';
+import { toast } from '@/service/toaster/toastService';
const router = createRouter({
history: createWebHistory(),
@@ -52,8 +52,7 @@ const router = createRouter({
document.title = nextTitle;
next(nextPath);
} catch (error) {
- const toast = useToast();
- toast.add({ type: 'danger', title: 'Error', description: `Unable to logout.` });
+ toast.add('Error', { type: 'danger', description: `Unable to logout.` });
console.log(error);
next('/');
diff --git a/resources/js/service/toaster/state.ts b/resources/js/service/toaster/state.ts
deleted file mode 100644
index 1c10d16e..00000000
--- a/resources/js/service/toaster/state.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import type { ExternalToast, Message, ToastOptions, ToastToDismiss, ToastType } from '@/types/pinesTypes';
-
-function UniqueComponentId(prefix = 'pv_id_') {
- return prefix + Math.random().toString(16).slice(2);
-}
-
-class Observer {
- subscribers: Array<(toast: Message | ToastToDismiss) => void>;
- toasts: Array<Message>;
-
- constructor() {
- this.subscribers = [];
- this.toasts = [];
- }
-
- // We use arrow functions to maintain the correct `this` reference
- subscribe = (subscriber: (toast: Message | ToastToDismiss) => void) => {
- this.subscribers.push(subscriber as any);
- return () => {
- const index = this.subscribers.indexOf(subscriber as any);
- this.subscribers.splice(index, 1);
- };
- };
-
- publish = (data: Message | ToastToDismiss) => {
- this.subscribers.forEach((subscriber) => subscriber(data));
- };
-
- addToast = (data: Message) => {
- this.publish(data);
- this.toasts = [...this.toasts, data];
- };
-
- create = (title: string, options: ToastOptions) => {
- const id = options.id ?? UniqueComponentId('toast_');
- const alreadyExists = this.toasts.find((toast) => {
- return toast.id === id;
- });
-
- if (alreadyExists) {
- this.toasts = this.toasts.map((toast) => {
- if (toast.id === id) {
- this.publish({ ...toast, ...options, id, title });
- return {
- ...toast,
- ...options,
- id,
- title,
- };
- }
-
- return toast;
- });
- } else {
- this.addToast({
- title,
- id,
- ...options,
- });
- }
-
- return id;
- };
- dismiss = (id?: string) => {
- if (!id) {
- this.toasts.forEach((toast) => {
- this.publish({ id: toast.id, dismiss: true });
- });
- this.toasts = [];
- } else {
- this.publish({ id, dismiss: true });
- this.toasts = this.toasts.filter((t) => t.id !== id);
- }
- };
-
- add = (message: string, options?: ToastOptions) => {
- return this.create(message, { ...options });
- };
-}
-
-export const ToastState = new Observer();
-
-function toastFunction(message: string, options?: ToastOptions) {
- const id = UniqueComponentId('toast_');
- ToastState.create(message, { ...options, id });
- return id;
-}
-
-export const toast = Object.assign(toastFunction, {
- add: ToastState.add,
- dismiss: ToastState.dismiss,
-});
diff --git a/resources/js/service/toaster/toastService.ts b/resources/js/service/toaster/toastService.ts
index 95f88a87..1c10d16e 100644
--- a/resources/js/service/toaster/toastService.ts
+++ b/resources/js/service/toaster/toastService.ts
@@ -1,25 +1,92 @@
-import type { Plugin } from 'vue';
-import { ToastSymbol } from '../../composables/useToast';
-import ToastEventBus from '../toastEventBus';
-import type { ToastOptions } from '@/types/pinesTypes';
-import { ToastController } from './component';
-import { toast } from './state';
-
-export { ToastController, toast };
-
-export default {
- install: (app: any) => {
- const ToastService = {
- add: (title: string, options: ToastOptions) => {
- ToastEventBus.emit('add', { title, options });
- },
- remove: (id: string) => {
- ToastEventBus.emit('close', id);
- },
+import type { ExternalToast, Message, ToastOptions, ToastToDismiss, ToastType } from '@/types/pinesTypes';
+
+function UniqueComponentId(prefix = 'pv_id_') {
+ return prefix + Math.random().toString(16).slice(2);
+}
+
+class Observer {
+ subscribers: Array<(toast: Message | ToastToDismiss) => void>;
+ toasts: Array<Message>;
+
+ constructor() {
+ this.subscribers = [];
+ this.toasts = [];
+ }
+
+ // We use arrow functions to maintain the correct `this` reference
+ subscribe = (subscriber: (toast: Message | ToastToDismiss) => void) => {
+ this.subscribers.push(subscriber as any);
+ return () => {
+ const index = this.subscribers.indexOf(subscriber as any);
+ this.subscribers.splice(index, 1);
};
+ };
+
+ publish = (data: Message | ToastToDismiss) => {
+ this.subscribers.forEach((subscriber) => subscriber(data));
+ };
+
+ addToast = (data: Message) => {
+ this.publish(data);
+ this.toasts = [...this.toasts, data];
+ };
+
+ create = (title: string, options: ToastOptions) => {
+ const id = options.id ?? UniqueComponentId('toast_');
+ const alreadyExists = this.toasts.find((toast) => {
+ return toast.id === id;
+ });
+
+ if (alreadyExists) {
+ this.toasts = this.toasts.map((toast) => {
+ if (toast.id === id) {
+ this.publish({ ...toast, ...options, id, title });
+ return {
+ ...toast,
+ ...options,
+ id,
+ title,
+ };
+ }
+
+ return toast;
+ });
+ } else {
+ this.addToast({
+ title,
+ id,
+ ...options,
+ });
+ }
+
+ return id;
+ };
+ dismiss = (id?: string) => {
+ if (!id) {
+ this.toasts.forEach((toast) => {
+ this.publish({ id: toast.id, dismiss: true });
+ });
+ this.toasts = [];
+ } else {
+ this.publish({ id, dismiss: true });
+ this.toasts = this.toasts.filter((t) => t.id !== id);
+ }
+ };
+
+ add = (message: string, options?: ToastOptions) => {
+ return this.create(message, { ...options });
+ };
+}
+
+export const ToastState = new Observer();
+
+function toastFunction(message: string, options?: ToastOptions) {
+ const id = UniqueComponentId('toast_');
+ ToastState.create(message, { ...options, id });
+ return id;
+}
- app.config.globalProperties.$toast = ToastService;
- app.provide(ToastSymbol, ToastService);
- app.component('ToastController');
- },
-};
+export const toast = Object.assign(toastFunction, {
+ add: ToastState.add,
+ dismiss: ToastState.dismiss,
+});
diff --git a/resources/js/service/toaster/toastServiceOld.ts b/resources/js/service/toaster/toastServiceOld.ts
new file mode 100644
index 00000000..a389d259
--- /dev/null
+++ b/resources/js/service/toaster/toastServiceOld.ts
@@ -0,0 +1,23 @@
+import type { Plugin } from 'vue';
+import { ToastSymbol } from '../../composables/useToast';
+import ToastEventBus from '../toastEventBus';
+import type { ToastOptions } from '@/types/pinesTypes';
+// import { toast } from './state';
+
+// export { toast };
+
+export default {
+ // install: (app: any) => {
+ // const ToastService = {
+ // add: (title: string, options: ToastOptions) => {
+ // ToastEventBus.emit('add', { title, options });
+ // },
+ // remove: (id: string) => {
+ // ToastEventBus.emit('close', id);
+ // },
+ // };
+ // app.config.globalProperties.$toast = ToastService;
+ // app.provide(ToastSymbol, ToastService);
+ // app.component('ToastController');
+ // },
+};
diff --git a/resources/js/stores/AuthStore.ts b/resources/js/stores/AuthStore.ts
index 09330272..523f763a 100644
--- a/resources/js/stores/AuthStore.ts
+++ b/resources/js/stores/AuthStore.ts
@@ -1,15 +1,13 @@
-import { ref } from 'vue';
+import { authenticate } from '@/service/authAPI';
import { defineStore } from 'pinia';
-import { authenticate } from '../service/authAPI';
-import { useToast } from '../composables/useToast';
import { AxiosError } from 'axios';
+import { ref } from 'vue';
+import { toast } from '@/service/toaster/toastService';
export const useAuthStore = defineStore('Auth', () => {
const userData = ref(null);
const user = ref(null);
- const toast = useToast();
-
const auth = async () => {
/*
Auth States:
@@ -39,7 +37,7 @@ export const useAuthStore = defineStore('Auth', () => {
return true;
} catch (error) {
console.log(error);
- toast.add({ type: 'warning', title: 'Session Expired', description: `Please log in again.` });
+ toast.add('Session Expired', { type: 'warning', description: `Please log in again.` });
clearAuthState();
return false;
}
diff --git a/resources/js/stores/ContentStore.js b/resources/js/stores/ContentStore.js
index b3bb1dd3..c582eb82 100755
--- a/resources/js/stores/ContentStore.js
+++ b/resources/js/stores/ContentStore.js
@@ -2,18 +2,15 @@ import { defineStore, storeToRefs } from 'pinia';
import { computed, ref } from 'vue';
import { useAuthStore } from './AuthStore';
import { useAppStore } from './AppStore';
-import { useToast } from '@/composables/useToast';
import { useRoute } from 'vue-router';
import recordsAPI from '@/service/recordsAPI';
import mediaAPI from '@/service/mediaAPI.ts';
export const useContentStore = defineStore('Content', () => {
- const AppStore = useAppStore();
const AuthStore = useAuthStore();
-
+ const AppStore = useAppStore();
const route = useRoute();
- const toast = useToast();
const fullRecordsLoaded = ref(false);
const stateRecords = ref([]);
diff --git a/resources/js/types/pinesTypes.ts b/resources/js/types/pinesTypes.ts
index 29c4bb83..0f91b8b5 100644
--- a/resources/js/types/pinesTypes.ts
+++ b/resources/js/types/pinesTypes.ts
@@ -73,4 +73,3 @@ export declare interface ToastToDismiss {
id: string;
dismiss: boolean;
}
-export declare const toast: (title: string, options?: ToastOptions) => string | number;
diff --git a/resources/js/views/HistoryView.vue b/resources/js/views/HistoryView.vue
index d21a97e5..9dc8151f 100755
--- a/resources/js/views/HistoryView.vue
+++ b/resources/js/views/HistoryView.vue
@@ -1,19 +1,18 @@
<script setup lang="ts">
import type { RecordResource } from '@/types/resources';
-import RecordCardDetails from '@/components/cards/RecordCardDetails.vue';
-import TableBase from '@/components/table/TableBase.vue';
-import LayoutBase from '@/layouts/LayoutBase.vue';
-import ModalBase from '@/components/pinesUI/ModalBase.vue';
-import useModal from '@/composables/useModal';
-
import { computed, onMounted, ref } from 'vue';
import { useContentStore } from '@/stores/ContentStore';
import { storeToRefs } from 'pinia';
import { useAppStore } from '@/stores/AppStore';
-import { useToast } from '@/composables/useToast';
+import { toast } from '@/service/toaster/toastService';
+
+import RecordCardDetails from '@/components/cards/RecordCardDetails.vue';
+import LayoutBase from '@/layouts/LayoutBase.vue';
+import ModalBase from '@/components/pinesUI/ModalBase.vue';
+import TableBase from '@/components/table/TableBase.vue';
+import useModal from '@/composables/useModal';
-const toast = useToast();
const appStore = useAppStore();
const ContentStore = useContentStore();
const loading = ref(true);
@@ -56,8 +55,8 @@ const handleDelete = (id: number) => {
const submitDelete = async () => {
if (cachedID.value) {
let request = await deleteRecord(cachedID.value);
- if (request) toast.add({ type: 'success', title: 'Success', description: 'Record Deleted Successfully!', life: 3000 });
- else toast.add({ type: 'warning', title: 'Error', description: 'Unable to delete record. Please try again.', life: 3000 });
+ if (request) toast.add('Success', { type: 'success', description: 'Record Deleted Successfully!', life: 3000 });
+ else toast.add('Error', { type: 'warning', description: 'Unable to delete record. Please try again.', life: 3000 });
}
};
diff --git a/resources/js/views/ProfileView.vue b/resources/js/views/ProfileView.vue
index 473d594f..ef40b9f4 100755
--- a/resources/js/views/ProfileView.vue
+++ b/resources/js/views/ProfileView.vue
@@ -2,13 +2,11 @@
import { useAppStore } from '../stores/AppStore';
import { storeToRefs } from 'pinia';
import { onMounted } from 'vue';
-import { useToast } from '../composables/useToast';
+import { toast } from '@/service/toaster/toastService';
import LayoutBase from '../layouts/LayoutBase.vue';
import ButtonText from '../components/inputs/ButtonText.vue';
-import { toast } from '@/service/toaster/state';
-const toastr = useToast();
const appStore = useAppStore();
const { pageTitle, selectedSideBar } = storeToRefs(appStore);