fix(pipedrive): check if there is no data in dynamic-data
This commit is contained in:
@@ -15,11 +15,7 @@ export default {
|
|||||||
`${$.auth.data.apiDomain}/api/v1/activityTypes`
|
`${$.auth.data.apiDomain}/api/v1/activityTypes`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!data?.data) {
|
if (data.data?.length) {
|
||||||
return { data: [] };
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.data.length) {
|
|
||||||
for (const activityType of data.data) {
|
for (const activityType of data.data) {
|
||||||
activityTypes.data.push({
|
activityTypes.data.push({
|
||||||
value: activityType.key_string,
|
value: activityType.key_string,
|
||||||
|
@@ -15,7 +15,7 @@ export default {
|
|||||||
`${$.auth.data.apiDomain}/api/v1/currencies`
|
`${$.auth.data.apiDomain}/api/v1/currencies`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (data.data.length) {
|
if (data.data?.length) {
|
||||||
for (const currency of data.data) {
|
for (const currency of data.data) {
|
||||||
currencies.data.push({
|
currencies.data.push({
|
||||||
value: currency.code,
|
value: currency.code,
|
||||||
|
@@ -19,11 +19,7 @@ export default {
|
|||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!data?.data) {
|
if (data.data?.length) {
|
||||||
return { data: [] };
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.data.length) {
|
|
||||||
for (const deal of data.data) {
|
for (const deal of data.data) {
|
||||||
deals.data.push({
|
deals.data.push({
|
||||||
value: deal.id,
|
value: deal.id,
|
||||||
|
@@ -15,11 +15,7 @@ export default {
|
|||||||
`${$.auth.data.apiDomain}/api/v1/leadLabels`
|
`${$.auth.data.apiDomain}/api/v1/leadLabels`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!data?.data) {
|
if (data.data?.length) {
|
||||||
return { data: [] };
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.data.length) {
|
|
||||||
for (const leadLabel of data.data) {
|
for (const leadLabel of data.data) {
|
||||||
const name = `${leadLabel.name} (${leadLabel.color})`;
|
const name = `${leadLabel.name} (${leadLabel.color})`;
|
||||||
leadLabels.data.push({
|
leadLabels.data.push({
|
||||||
|
@@ -19,11 +19,7 @@ export default {
|
|||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!data?.data) {
|
if (data.data?.length) {
|
||||||
return { data: [] };
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.data.length) {
|
|
||||||
for (const lead of data.data) {
|
for (const lead of data.data) {
|
||||||
leads.data.push({
|
leads.data.push({
|
||||||
value: lead.id,
|
value: lead.id,
|
||||||
|
@@ -15,11 +15,7 @@ export default {
|
|||||||
`${$.auth.data.apiDomain}/api/v1/organizations`
|
`${$.auth.data.apiDomain}/api/v1/organizations`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!data?.data) {
|
if (data.data?.length) {
|
||||||
return { data: [] };
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.data.length) {
|
|
||||||
for (const organization of data.data) {
|
for (const organization of data.data) {
|
||||||
organizations.data.push({
|
organizations.data.push({
|
||||||
value: organization.id,
|
value: organization.id,
|
||||||
|
@@ -23,7 +23,7 @@ export default {
|
|||||||
);
|
);
|
||||||
params.start = data.additional_data?.pagination?.next_start;
|
params.start = data.additional_data?.pagination?.next_start;
|
||||||
|
|
||||||
if (data.data.length) {
|
if (data.data?.length) {
|
||||||
for (const person of data.data) {
|
for (const person of data.data) {
|
||||||
persons.data.push({
|
persons.data.push({
|
||||||
value: person.id,
|
value: person.id,
|
||||||
|
@@ -13,7 +13,7 @@ export default {
|
|||||||
|
|
||||||
const { data } = await $.http.get(`${$.auth.data.apiDomain}/api/v1/users`);
|
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) {
|
for (const user of data.data) {
|
||||||
users.data.push({
|
users.data.push({
|
||||||
value: user.id,
|
value: user.id,
|
||||||
|
Reference in New Issue
Block a user