You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
910 B
47 lines
910 B
<script setup>
|
|
import { ref } from "vue"
|
|
|
|
import Skeleton from "primevue/skeleton"
|
|
|
|
import { useNotification } from "../../composables/notification"
|
|
|
|
import * as skillProfileService from "../../services/skillProfileService"
|
|
|
|
const { showErrorNotification } = useNotification()
|
|
|
|
const containerEl = ref()
|
|
const isLoading = ref(false)
|
|
|
|
/**
|
|
* @param {Array<Object>} skills
|
|
* @returns {Promise<void>}
|
|
*/
|
|
async function searchProfileMatches(skills) {
|
|
isLoading.value = true
|
|
|
|
const skillIdList = skills.map((skill) => skill.id)
|
|
|
|
try {
|
|
containerEl.value.innerHTML = await skillProfileService.matchProfiles(skillIdList)
|
|
} catch (e) {
|
|
showErrorNotification(e)
|
|
} finally {
|
|
isLoading.value = false
|
|
}
|
|
}
|
|
|
|
defineExpose({
|
|
searchProfileMatches,
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<Skeleton
|
|
v-if="isLoading"
|
|
height="10rem"
|
|
/>
|
|
<div
|
|
v-show="!isLoading"
|
|
ref="containerEl"
|
|
/>
|
|
</template>
|
|
|