fix(pipedrive): check if there is no data in dynamic-data

This commit is contained in:
Rıdvan Akca
2023-10-18 10:37:16 +03:00
parent 0fca0ef734
commit 961d55a1c6
8 changed files with 8 additions and 28 deletions

View File

@@ -15,11 +15,7 @@ export default {
`${$.auth.data.apiDomain}/api/v1/activityTypes`
);
if (!data?.data) {
return { data: [] };
}
if (data.data.length) {
if (data.data?.length) {
for (const activityType of data.data) {
activityTypes.data.push({
value: activityType.key_string,

View File

@@ -15,7 +15,7 @@ export default {
`${$.auth.data.apiDomain}/api/v1/currencies`
);
if (data.data.length) {
if (data.data?.length) {
for (const currency of data.data) {
currencies.data.push({
value: currency.code,

View File

@@ -19,11 +19,7 @@ export default {
params,
});
if (!data?.data) {
return { data: [] };
}
if (data.data.length) {
if (data.data?.length) {
for (const deal of data.data) {
deals.data.push({
value: deal.id,

View File

@@ -15,11 +15,7 @@ export default {
`${$.auth.data.apiDomain}/api/v1/leadLabels`
);
if (!data?.data) {
return { data: [] };
}
if (data.data.length) {
if (data.data?.length) {
for (const leadLabel of data.data) {
const name = `${leadLabel.name} (${leadLabel.color})`;
leadLabels.data.push({

View File

@@ -19,11 +19,7 @@ export default {
params,
});
if (!data?.data) {
return { data: [] };
}
if (data.data.length) {
if (data.data?.length) {
for (const lead of data.data) {
leads.data.push({
value: lead.id,

View File

@@ -15,11 +15,7 @@ export default {
`${$.auth.data.apiDomain}/api/v1/organizations`
);
if (!data?.data) {
return { data: [] };
}
if (data.data.length) {
if (data.data?.length) {
for (const organization of data.data) {
organizations.data.push({
value: organization.id,

View File

@@ -23,7 +23,7 @@ export default {
);
params.start = data.additional_data?.pagination?.next_start;
if (data.data.length) {
if (data.data?.length) {
for (const person of data.data) {
persons.data.push({
value: person.id,

View File

@@ -13,7 +13,7 @@ export default {
const { data } = await $.http.get(`${$.auth.data.apiDomain}/api/v1/users`);
if (data.data.length) {
if (data.data?.length) {
for (const user of data.data) {
users.data.push({
value: user.id,