Skip to content

Commit

Permalink
fix: 修复Console快速拉取条目后无法定位到对应条目的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chivehao committed Oct 19, 2024
1 parent 3e9f8d8 commit 01d8894
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 12 additions & 4 deletions console/src/modules/content/subject/SubjectSyncDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,28 @@ const onConfirm = async (formEl: FormInstance | undefined) => {
if (valid) {
syncButtonLoading.value = true;
console.log('subjectSync', subjectSync.value);
const { data } = await apiClient.subjectSyncPlatform
await apiClient.subjectSync
.syncSubjectAndPlatform({
// @ts-ignore
platform: subjectSync.value.platform,
platformId: subjectSync.value.platformId,
// @ts-ignore
action: subjectSync.value.action,
subjectId: subjectId.value as number,
})
.finally(() => {
syncButtonLoading.value = false;
});
const { data } = await apiClient.subjectSync.getSubjectSyncsByPlatformAndPlatformId({
// @ts-ignore
platform: subjectSync.value.platform,
// @ts-ignore
platformId: subjectSync.value.platformId as number,
})
if (data.length > 0) {
const rsp = await apiClient.subject.searchSubjectById({id: data[0].subjectId as number})
emit('closeWithSubjectName', rsp.data);
}
dialogVisible.value = false;
emit('closeWithSubjectName', data);
// emit('closeWithSubjectName', data);
} else {
console.log('error submit!', fields);
ElMessage.error(t('module.subject.dialog.sync.message.validate-fail'));
Expand Down
8 changes: 2 additions & 6 deletions console/src/utils/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
V1alpha1StaticApi,
V1alpha1SubjectApi,
V1alpha1SubjectRelationApi,
V1alpha1SubjectSyncPlatformApi,
V1alpha1SubjectSyncApi,
V1alpha1TagApi,
V1alpha1TaskApi,
V1alpha1UserApi,
Expand Down Expand Up @@ -179,11 +179,7 @@ function setupApiClient(axios: AxiosInstance) {
axios
),
subject: new V1alpha1SubjectApi(undefined, baseURL, axios),
subjectSyncPlatform: new V1alpha1SubjectSyncPlatformApi(
undefined,
baseURL,
axios
),
subjectSync: new V1alpha1SubjectSyncApi(undefined, baseURL, axios),
indices: new V1alpha1IndicesApi(undefined, baseURL, axios),
task: new V1alpha1TaskApi(undefined, baseURL, axios),
collectionSubject: new V1alpha1CollectionSubjectApi(
Expand Down

0 comments on commit 01d8894

Please sign in to comment.