Fix select app

This commit is contained in:
xue jiahao
2024-11-20 16:04:40 +08:00
parent 3f98e17215
commit bf4abe3cad
2 changed files with 27 additions and 47 deletions

View File

@@ -328,8 +328,22 @@ const fetchData = async () => {
}
const fetchAppById = async(id: string) => {
const result = await api.get('api/apps');
return result.data.find((item: IManagedApp) => item.appid === id ) as IManagedApp;
try {
const result = await api.get('api/apps');
return result.data.find((item: IManagedApp) => item.appid === id ) as IManagedApp;
} catch (e) {
console.error(e);
const result = await api.get(`api/v1/app?app=${id}`);
const data = result?.data;
if (data?.message) {
$q.notify({
type: 'negative',
caption: "エラー",
message: data.message
});
}
return { appid: data.appId, appname: data.name };
}
}
const onClearFilter=()=>{