Create videos frontend
This commit is contained in:
40
src/stores/KsVideoGroupStore.js
Normal file
40
src/stores/KsVideoGroupStore.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { computed, ref } from 'vue';
|
||||
import { KsVideoGroupService } from '../service/KsVideoGroupService';
|
||||
|
||||
export const KsVideoGroupStore = defineStore('ksvideogroup_store', () => {
|
||||
const lstKsVideoGroup = ref([]);
|
||||
const selectedKsVideoGroup = ref(null);
|
||||
|
||||
async function fetchKsVideoGroup(projectId) {
|
||||
try {
|
||||
const response = await KsVideoGroupService.getKsVideoGroups(projectId);
|
||||
lstKsVideoGroup.value = response.data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching video groups:', error);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
const ksVideoGroup = computed(() => {
|
||||
return lstKsVideoGroup.value;
|
||||
});
|
||||
|
||||
const getSelectedKsVideoGroup = computed(() => {
|
||||
return selectedKsVideoGroup.value;
|
||||
});
|
||||
|
||||
async function setSelectedKsVideoGroup(group) {
|
||||
selectedKsVideoGroup.value = group;
|
||||
console.log('selectedVideoGroup', selectedKsVideoGroup.value);
|
||||
}
|
||||
|
||||
return {
|
||||
fetchKsVideoGroup,
|
||||
selectedKsVideoGroup,
|
||||
lstKsVideoGroup,
|
||||
ksVideoGroup,
|
||||
getSelectedKsVideoGroup,
|
||||
setSelectedKsVideoGroup
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user