File tree Expand file tree Collapse file tree
app/javascript/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,8 +22,11 @@ export const fetchCustomers = {
2222 const response = await fetch ( customer . logo_url )
2323
2424 if ( response . ok ) {
25+ const contentType = response . headers . get ( "Content-Type" )
2526 const blob = await response . blob ( )
26- formData . append ( 'customer[logo]' , blob )
27+ const fileName = `logo.${ contentType . split ( "/" ) [ 1 ] || "png" } `
28+
29+ formData . append ( 'customer[logo]' , blob , fileName )
2730 } else {
2831 throw new Error ( 'Failed to fetch logo' )
2932 }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export const PcDropdownSelect = ({
3232 options = { options }
3333 placeholder = { placeholder }
3434 filterBy = { handleFilterBy }
35- allowNew = { false }
35+ allowNew
3636 newSelectionPrefix = "Add new customer: "
3737 className = { `${ hasIcon ? isMenuOpen ? 'pc-typeahead-arrow-up' : 'pc-typeahead-arrow-down' : '' } border border-primary rounded-1` }
3838 style = { { height } }
You can’t perform that action at this time.
0 commit comments