Skip to content

Commit

Permalink
Allow empty theme files to be uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
graygilmore committed Dec 3, 2024
1 parent 4721974 commit f7a9324
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/cli-kit/src/public/node/themes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
})
}
Expand Down

0 comments on commit f7a9324

Please sign in to comment.