forked from ddrilling/asb_cloud_front
Исправлено отсутствие отправки запроса на слияние телеметрий
This commit is contained in:
parent
fcb264b122
commit
d37ceeb68f
@ -59,14 +59,13 @@ export const TelemetryMerger = memo(() => {
|
|||||||
|
|
||||||
const mergeTelemetry = useCallback(() => invokeWebApiWrapperAsync(
|
const mergeTelemetry = useCallback(() => invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
await new Promise(res => setTimeout(res, 1000))
|
await AdminTelemetryService.mergeTelemetries(secondary.id, primary.id)
|
||||||
/// await AdminTelemetryService.mergeTelemetries(secondary.id, primary.id)
|
|
||||||
await updateTelemetry()
|
await updateTelemetry()
|
||||||
},
|
},
|
||||||
setIsMerging,
|
setIsMerging,
|
||||||
'Не удалось объединить телеметрии',
|
'Не удалось объединить телеметрии',
|
||||||
'Объединение телеметрий',
|
'Объединение телеметрий',
|
||||||
), [updateTelemetry])
|
), [updateTelemetry, secondary.id, primary.id])
|
||||||
|
|
||||||
useEffect(() => updateTelemetry(), [updateTelemetry])
|
useEffect(() => updateTelemetry(), [updateTelemetry])
|
||||||
|
|
||||||
@ -76,7 +75,6 @@ export const TelemetryMerger = memo(() => {
|
|||||||
const secondaryId = parseInt(query.get('secondary') ?? null)
|
const secondaryId = parseInt(query.get('secondary') ?? null)
|
||||||
const primary = isNaN(primaryId) ? null : telemetry.find((t) => t.id === primaryId)
|
const primary = isNaN(primaryId) ? null : telemetry.find((t) => t.id === primaryId)
|
||||||
const secondary = isNaN(secondaryId) ? null : telemetry.find((t) => t.id === secondaryId)
|
const secondary = isNaN(secondaryId) ? null : telemetry.find((t) => t.id === secondaryId)
|
||||||
console.log([primary, secondary])
|
|
||||||
setPrimary(primary)
|
setPrimary(primary)
|
||||||
setSecondary(secondary)
|
setSecondary(secondary)
|
||||||
}, [location, telemetry])
|
}, [location, telemetry])
|
||||||
|
Loading…
Reference in New Issue
Block a user