204204 </v-col >
205205 </div >
206206 </template >
207+ <template v-slot :no-data >
208+ <v-alert v-if =" error" class =" text-left" density =" compact" type =" error" >
209+ {{ error }}
210+ </v-alert >
211+ <p v-else-if =" Object.keys(filters).length > 0" >
212+ No results matched your search.
213+ </p >
214+ <p v-else >No data available</p >
215+ </template >
207216 </v-data-table-server >
208217
209218 <v-dialog v-model =" dialog.open" max-width =" 500px" >
@@ -447,6 +456,7 @@ export default {
447456 uuid: " " ,
448457 },
449458 selected: [],
459+ error: null ,
450460 };
451461 },
452462 computed: {
@@ -472,24 +482,30 @@ export default {
472482 ) {
473483 if (this .disabledSearch ) return ;
474484 this .loading = true ;
475- let response = await this .fetchPage (
476- page,
477- this .itemsPerPage ,
478- filters,
479- orderBy
480- );
481- if (response) {
482- this .individuals = formatIndividuals (
483- response .data .individuals .entities
485+ this .error = null ;
486+ try {
487+ let response = await this .fetchPage (
488+ page,
489+ this .itemsPerPage ,
490+ filters,
491+ orderBy
484492 );
485- this .pageCount = response .data .individuals .pageInfo .numPages ;
486- this .page = response .data .individuals .pageInfo .page ;
487- this .totalResults = response .data .individuals .pageInfo .totalResults ;
488- this .allSelected = false ;
489- this .$emit (" updateIndividuals" , this .individuals );
493+ if (response) {
494+ this .individuals = formatIndividuals (
495+ response .data .individuals .entities
496+ );
497+ this .pageCount = response .data .individuals .pageInfo .numPages ;
498+ this .page = response .data .individuals .pageInfo .page ;
499+ this .totalResults = response .data .individuals .pageInfo .totalResults ;
500+ this .allSelected = false ;
501+ this .$emit (" updateIndividuals" , this .individuals );
502+ }
503+ } catch (error) {
504+ this .error = this .$getErrorMessage (error);
505+ } finally {
506+ this .loading = false ;
507+ this .selected = [];
490508 }
491- this .loading = false ;
492- this .selected = [];
493509 },
494510 startDrag (item , isSelected , toggleSelect , event ) {
495511 if (! isSelected (item)) {
0 commit comments