Skip to content

Commit

Permalink
Display errmsg when on search-detail without id
Browse files Browse the repository at this point in the history
  • Loading branch information
joschrew committed Oct 29, 2024
1 parent fecfc3e commit d863da2
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/pages/search-detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default {
error_msg: null,
loading: true,
response: null,
isUserLoggedIn: this,
isUserLoggedIn: false,
listenerKey: -1,
moveTriggered: false,
};
Expand Down Expand Up @@ -198,9 +198,14 @@ export default {
this.loading = false;
}
},
async loadArchiveInfo() {
let response = await lzaApi.getArchiveInfo(this.id, 0, 0, false);
this.archiveInfo = response.data;
try {
let response = await lzaApi.getArchiveInfo(this.id, 0, 0, false);
this.archiveInfo = response.data;
} catch (error) {
this.archiveInfo = {}
}
},
exportArchive() {
Expand Down Expand Up @@ -277,8 +282,14 @@ export default {
},
},
async created() {
await this.loadData();
await this.loadArchiveInfo();
if (!this.id) {
this.error = true;
this.error_msg = "PID is missing";
this.loading = false;
} else {
await this.loadData();
await this.loadArchiveInfo();
}
},
async unmounted() {
authService.removeLoggedInListener(this.listenerKey);
Expand Down

0 comments on commit d863da2

Please sign in to comment.