From f7a93247f10fa0c0b083e91eaa3735ae3a5e1c5e Mon Sep 17 00:00:00 2001 From: Gray Gilmore Date: Tue, 3 Dec 2024 10:58:19 -0800 Subject: [PATCH] Allow empty theme files to be uploaded --- packages/cli-kit/src/public/node/themes/api.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/cli-kit/src/public/node/themes/api.ts b/packages/cli-kit/src/public/node/themes/api.ts index 23966667812..706a9eae093 100644 --- a/packages/cli-kit/src/public/node/themes/api.ts +++ b/packages/cli-kit/src/public/node/themes/api.ts @@ -119,24 +119,22 @@ export async function bulkUploadThemeAssets( function prepareFilesForUpload(assets: AssetParams[]): OnlineStoreThemeFilesUpsertFileInput[] { return assets.map((asset) => { - if (asset.value) { + if (asset.attachment) { return { filename: asset.key, body: { - type: 'TEXT' as const, - value: asset.value, + type: 'BASE64' as const, + value: asset.attachment, }, } - } else if (asset.attachment) { + } else { return { filename: asset.key, body: { - type: 'BASE64' as const, - value: asset.attachment, + type: 'TEXT' as const, + value: asset.value ?? '', }, } - } else { - unexpectedGraphQLError('Asset must have a value or attachment') } }) }