Исправлено отсутствие отправки запроса на слияние телеметрий

This commit is contained in:
goodmice 2022-04-12 10:22:31 +05:00
parent fcb264b122
commit d37ceeb68f

View File

@ -59,14 +59,13 @@ export const TelemetryMerger = memo(() => {
const mergeTelemetry = useCallback(() => invokeWebApiWrapperAsync(
async () => {
await new Promise(res => setTimeout(res, 1000))
/// await AdminTelemetryService.mergeTelemetries(secondary.id, primary.id)
await AdminTelemetryService.mergeTelemetries(secondary.id, primary.id)
await updateTelemetry()
},
setIsMerging,
'Не удалось объединить телеметрии',
'Объединение телеметрий',
), [updateTelemetry])
), [updateTelemetry, secondary.id, primary.id])
useEffect(() => updateTelemetry(), [updateTelemetry])
@ -76,7 +75,6 @@ export const TelemetryMerger = memo(() => {
const secondaryId = parseInt(query.get('secondary') ?? null)
const primary = isNaN(primaryId) ? null : telemetry.find((t) => t.id === primaryId)
const secondary = isNaN(secondaryId) ? null : telemetry.find((t) => t.id === secondaryId)
console.log([primary, secondary])
setPrimary(primary)
setSecondary(secondary)
}, [location, telemetry])