Skip to content

Commit

Permalink
FIX when source is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
eboileau committed May 27, 2024
1 parent 19f8f44 commit dbc3668
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 1 addition & 4 deletions client/src/components/dataset/ProjectDetailsTable.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup>
import DataTable from 'primevue/datatable'
import { ref, onMounted } from 'vue'
import { splitStr } from '@/utils/index.js'
import { loadProjects } from '@/services/project'
const props = defineProps({
Expand All @@ -13,10 +14,6 @@ const props = defineProps({
const projectsById = ref(new Map())
const project = ref([])
function splitStr(str) {
return str.split(',')
}
onMounted(() => {
// list all projects by id
loadProjects(null, projectsById)
Expand Down
5 changes: 1 addition & 4 deletions client/src/components/project/ProjectList.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<script setup>
import { ref, inject, onMounted } from 'vue'
import { splitStr } from '@/utils/index.js'
import { loadProjects } from '@/services/project'
const dialogRef = inject('dialogRef')
const records = ref()
const splitStr = (str) => {
return str.split(',')
}
onMounted(() => {
// only list my projects
loadProjects(records, null, true)
Expand Down
8 changes: 8 additions & 0 deletions client/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,11 @@ export function fmtFilter(object) {
})
.filter((item) => item)
}

export function splitStr(str) {
if (typeof str === 'string') {
return str.split(',')
} else {
return []
}
}

0 comments on commit dbc3668

Please sign in to comment.