decord/source/modules/harvester/DataHarvestActionCreators.tsx

45 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 14288
// Function ID: 14289
2026-07-20 16:05:17 +00:00
// Name: getDataHarvestStatus
2026-08-24 06:08:38 +00:00
// Dependencies: [676, 709, 530, 8657, 2]
2026-07-20 16:05:17 +00:00
// Exports: getDataHarvestStatus, requestDataHarvest
2026-08-24 06:08:38 +00:00
// Module 14288 (getDataHarvestStatus)
import set from "set" /* 2 */;
import sendRequest from "sendRequest" /* 530 */;
import ME from "ME" /* 676 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import saveProfileAndAccountRequest from "saveProfileAndAccountRequest" /* 8657 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const Endpoints = ME.Endpoints;
const result = set.fileFinishedImporting("modules/harvester/DataHarvestActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const getDataHarvestStatus = function getDataHarvestStatus() {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj.dispatch({ type: "LOAD_DATA_HARVEST_TYPE_START" });
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-23 10:11:24 +00:00
obj = { url: Endpoints.USER_HARVEST, oldFormErrors: true, rejectWithError: false };
2026-07-20 16:05:17 +00:00
const value = HTTP.get(obj);
return value.then((body) => {
2026-07-29 08:29:29 +00:00
let obj = callback(709);
2026-07-20 16:05:17 +00:00
obj = { type: "UPDATE_DATA_HARVEST_TYPE", harvestType: body.body };
obj.dispatch(obj);
}).catch((error) => {
2026-07-29 08:29:29 +00:00
let obj = callback(709);
2026-07-20 16:05:17 +00:00
obj = { type: "LOAD_DATA_HARVEST_TYPE_FAILURE", error };
obj.dispatch(obj);
});
};
export const requestDataHarvest = function requestDataHarvest(mapped) {
2026-08-24 06:08:38 +00:00
const harvest = saveProfileAndAccountRequest.requestHarvest(mapped);
2026-07-20 16:05:17 +00:00
return harvest.then((body) => {
if (tmp) {
2026-07-29 08:29:29 +00:00
let obj = callback(table[1]);
obj = { type: "UPDATE_DATA_HARVEST_TYPE", harvestType: null };
obj[1] = body.body;
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
}
return body;
});
};