fix: Add Attachment endpoint to save file against automation rule (#4480)
Co-authored-by: fayazara <fayazara@gmail.com> Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
parent
2acb48bbe0
commit
1b3011b27b
18 changed files with 291 additions and 57 deletions
|
@ -1,7 +1,15 @@
|
|||
const allElementsString = arr => {
|
||||
return arr.every(elem => typeof elem === 'string');
|
||||
};
|
||||
|
||||
const allElementsNumbers = arr => {
|
||||
return arr.every(elem => typeof elem === 'number');
|
||||
};
|
||||
|
||||
const formatArray = params => {
|
||||
if (params.length <= 0) {
|
||||
params = [];
|
||||
} else if (params.every(elem => typeof elem === 'string')) {
|
||||
} else if (allElementsString(params) || allElementsNumbers(params)) {
|
||||
params = [...params];
|
||||
} else {
|
||||
params = params.map(val => val.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue