更新数据失败
@@ -148,7 +148,7 @@ const props = defineProps({
},
});
-const emits = defineEmits(['openEdit', 'update', 'selectionChange', 'delete']);
+const emits = defineEmits(['openEdit', 'update', 'selectionChange', 'delete', 'updateSyncStatus']);
const router = useRouter();
@@ -174,9 +174,6 @@ const isSyncing = (item) => {
if (!props.syncMediaAccounts.length) return false;
const target = props.syncMediaAccounts.find((v) => v.id === item.id);
- if(target) {
- return target?.status === 0;
- }
return target?.status === 0;
};
@@ -268,7 +265,7 @@ const goDetail = (item) => {
const onDeleteSyncStatus = async (item) => {
await deleteSyncStatus(item.id);
- item.status = 1;
+ emits('updateSyncStatus', item);
};
const formatTime = (time) => {
return exactFormatTime(time, 'YYYY-MM-DD HH:mm:ss', 'YYYY-MM-DD HH:mm:ss');
@@ -282,6 +279,10 @@ const getLastSyncedAt = (item) => {
}
return formatTime(item.last_synced_at);
};
+const isSyncFailed = (item) => {
+ const target = props.syncMediaAccounts.find((v) => v.id === item.id);
+ return target?.status === 2;
+};