import apiClient from "./apiClient";

const router = '/printing';

const printingApi = {
    getLabel: async (orderId: number): Promise<string> => {
        let response = await apiClient.get(`${router}/getLabel?orderId=${orderId}`, {responseType: 'arraybuffer'});
        const binaryString = String.fromCharCode(...new Uint8Array(response.data));

        return btoa(binaryString);
    },
}
export default printingApi;