refactor: restructure project to classic MVC pattern

This commit is contained in:
2025-09-09 19:57:43 +02:00
parent a28728af2a
commit 2a8d5d093c
58 changed files with 1601 additions and 1991 deletions

View File

@@ -0,0 +1,25 @@
import {onMounted, ref} from "vue";
import {ProfileService} from "@/infrastructure/api/ProfileService";
import {GetProfile} from "@/domain/usecases/GetProfile";
const profileService = new ProfileService();
const getProfileUseCase = new GetProfile(profileService);
export function useProfile() {
const profile = ref<any>(null);
const loading = ref(false);
const error = ref<string | null>(null);
onMounted(async () => {
loading.value = true;
try {
profile.value = await getProfileUseCase.execute();
} catch (err: any) {
error.value = err.message;
} finally {
loading.value = false;
}
});
return {profile, loading};
}