UNPKG

nexus-react-core

Version:

A comprehensive React toolkit with services, hooks, and Redux store management

52 lines 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.skipImageAssignment = exports.getImageAssignmentBatch = void 0; const apiCall_1 = require("../hooks/apiCall"); /** * Fetches a batch of image assignments for a specific mission * @param missionId The ID of the mission * @param count Optional number of images to fetch (default: 3) */ const getImageAssignmentBatch = async (missionId, count = 3) => { try { const response = await (0, apiCall_1.apiCall)('/image-assignments/get-batch', 'POST', { missionId, count, }); return response; } catch (error) { console.error('Error fetching image assignment batch:', error); return { success: false, data: null, message: 'Failed to fetch image assignments', }; } }; exports.getImageAssignmentBatch = getImageAssignmentBatch; /** * Skips an image assignment * @param missionId The ID of the mission * @param imageKey The key of the image to skip * @param reason Optional reason for skipping */ const skipImageAssignment = async (missionId, imageKey, reason) => { try { const response = await (0, apiCall_1.apiCall)('/image-assignments/skip', 'PUT', { missionId, imageKey, reason, }); return response; } catch (error) { console.error('Error skipping image assignment:', error); return { success: false, message: 'Failed to skip image assignment', }; } }; exports.skipImageAssignment = skipImageAssignment; //# sourceMappingURL=imageAssignmentService.js.map