Skip to content
Snippets Groups Projects
Commit 39c6b31e authored by Oussama's avatar Oussama Committed by bbenarbia
Browse files

fix update customer issue

parent 05f58dc9
No related branches found
No related tags found
No related merge requests found
......@@ -330,7 +330,7 @@ public class CustomerInternalService extends VitamUICrudService<CustomerDto, Cus
"Unable to patch customer " + customer.getId() + ": value for " + entry.getKey() +
" is not allowed, because the main setting is readOnly, please contact your administrator to update it");
} else {
if (customer.getGdprAlertDelay() > 0) {
if(CastUtils.toInt(entry.getValue()) > 0) {
logbooks.add(
new EventDiffDto(CustomerConverter.GDPR_ALERT_DELAY_KEY, customer.getGdprAlertDelay(),
entry.getValue()));
......@@ -338,9 +338,9 @@ public class CustomerInternalService extends VitamUICrudService<CustomerDto, Cus
break;
} else {
LOGGER.error(
"Wrong value , gdprAlertDelay because the value should be greater than 0 ");
"Wrong value , gdprAlertDelay should be greater than 0 ");
throw new IllegalArgumentException(
"Wrong value , gdprAlertDelay because the value should be greater than 0");
"Wrong value , gdprAlertDelay should be greater than 0");
}
}
case "gdprAlert":
......
......@@ -83,6 +83,7 @@ export class CustomerApiService extends BaseHttpClient<Customer> {
patchCustomer(partialCustomer: { id: string, [key: string]: any }, logos?: Logo[], headers?: HttpHeaders): Observable<Customer> {
const formData: FormData = new FormData();
formData.append('partialCustomerDto', JSON.stringify({ // to not send header/footer/portal -url
id: partialCustomer.id,
hasCustomGraphicIdentity: partialCustomer.hasCustomGraphicIdentity,
themeColors: partialCustomer.themeColors,
......@@ -99,6 +100,9 @@ export class CustomerApiService extends BaseHttpClient<Customer> {
language: partialCustomer.language,
emailDomains: partialCustomer.emailDomains,
defaultEmailDomain: partialCustomer.defaultEmailDomain,
gdprAlert: partialCustomer.gdprAlert,
gdprAlertDelay: partialCustomer.gdprAlertDelay,
}));
if (logos) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment