Skip to content

Commit

Permalink
fixed hsm bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 committed Jan 16, 2025
1 parent e20e313 commit 20ebd22
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/containers/HSM/HSM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ export const HSM = () => {
delete payloadCopy.variables;
delete payloadCopy.existingShortcode;
delete payloadCopy.newShortcode;
delete payloadCopy.attachmentURL;
return payloadCopy;
};

Expand Down Expand Up @@ -664,18 +663,22 @@ export const HSM = () => {
}),
templateButtons: Yup.array().of(
Yup.lazy(() => {
if (templateType === 'CALL_TO_ACTION') {
return Yup.object().shape({
type: Yup.string().required('Type is required.'),
title: Yup.string().required('Title is required.'),
value: Yup.string().required('Value is required.'),
});
} else if (templateType === 'QUICK_REPLY') {
return Yup.object().shape({
value: Yup.string().required('Value is required.'),
});
if (isAddButtonChecked) {
if (templateType === 'CALL_TO_ACTION') {
return Yup.object().shape({
type: Yup.string().required('Type is required.'),
title: Yup.string().required('Title is required.'),
value: Yup.string().required('Value is required.'),
});
} else if (templateType === 'QUICK_REPLY') {
return Yup.object().shape({
value: Yup.string().required('Value is required.'),
});
}
return Yup.object().shape({});
} else {
return Yup.object().shape({});
}
return Yup.object().shape({});
})
),
};
Expand Down

0 comments on commit 20ebd22

Please sign in to comment.