
* Require trailing commas * Add trailing commas * Add trailing commas in testUtils dir * Add trailing commas
27 lines
514 B
TypeScript
27 lines
514 B
TypeScript
import { ExportScope } from "@saleor/graphql";
|
|
import { ExportSettingsFormData } from "@saleor/products/components/ProductExportDialog/types";
|
|
|
|
interface ExportGiftCardsInputProps {
|
|
ids: string[] | null;
|
|
data: ExportSettingsFormData;
|
|
}
|
|
|
|
export const getExportGiftCardsInput = ({
|
|
data,
|
|
ids,
|
|
}: ExportGiftCardsInputProps) => {
|
|
const { scope, fileType } = data;
|
|
|
|
if (scope === ExportScope.IDS) {
|
|
return {
|
|
fileType,
|
|
scope,
|
|
ids,
|
|
};
|
|
}
|
|
|
|
return {
|
|
fileType,
|
|
scope,
|
|
};
|
|
};
|