fix(VnUserLink): initialize isWorker to false and simplify error handling
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-05-06 10:17:04 +02:00
parent 8f1533d496
commit ebfc9daacd
1 changed files with 2 additions and 5 deletions

View File

@ -9,7 +9,7 @@ const $props = defineProps({
workerId: { type: Number, default: null },
defaultName: { type: Boolean, default: false },
});
const isWorker = ref();
const isWorker = ref(false);
onMounted(async () => {
try {
@ -18,10 +18,7 @@ onMounted(async () => {
} = await axios(`/Workers/${$props.workerId}/exists`);
isWorker.value = exists;
} catch (error) {
if (error.status === 403) {
isWorker.value = false;
return;
}
if (error.status === 403) return;
throw error;
}
});