Skip to content

Commit

Permalink
Fix site settings not updating (#5591)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad authored Nov 30, 2023
1 parent f8a6636 commit b1d00c1
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,18 @@ export default function useUpdateSiteSetting(name) {

const uploadPresentation = (data) => {
let settings;
let headers = { 'Content-Type': 'application/json' };

if (name === 'BrandingImage') {
fileValidation(data, 'image');
settings = new FormData();
settings.append('site_setting[value]', data);
headers = { 'Content-Type': 'multipart/form-data' };
} else {
settings = data;
}

return axios.patch(`/admin/site_settings/${name}.json`, settings, {
headers: {
'Content-Type': 'multipart/form-data',
},
});
return axios.patch(`/admin/site_settings/${name}.json`, settings, { headers });
};

const handleSuccess = () => {
Expand Down

0 comments on commit b1d00c1

Please sign in to comment.