/**
 * @desc 获取盘点的待扫码信息
 */
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
export default async function (
	/** 申请单ID */
	applyId: number,

	success: (data: Array<material.WaitScanInfo>) => void = defaultSuccess,
	fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
	return http({
		method: 'get',
		url: `/wait-scan-data/${applyId}`,
	})
		.then((data: AxiosResponse<Array<material.WaitScanInfo>, unknown>) => {
			success(data.data)
		})
		.catch((error: { code: string; error?: string }) => fail(error))
}
