Skip to content

Commit 0dbdb33

Browse files
committed
Object property name adjustments
1 parent 3e4105b commit 0dbdb33

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

components/webflow_v2/webflow_v2.app.mjs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default {
3636
const collections = await this.getCollections(siteId);
3737

3838
return collections.map((collection) => ({
39-
label: collection.name,
39+
label: collection.displayName || collection.slug,
4040
value: collection.id,
4141
}));
4242
},
@@ -51,7 +51,7 @@ export default {
5151
const items = await this.getItems(page, collectionId);
5252

5353
return items.map((item) => ({
54-
label: item.name,
54+
label: item.fieldData?.name || item.fieldData?.slug,
5555
value: item.id,
5656
}));
5757
},
@@ -202,9 +202,7 @@ export default {
202202
async getCollection(collectionId) {
203203
const webflow = this._createApiClient();
204204

205-
return await webflow.collections.get({
206-
collectionId,
207-
});
205+
return await webflow.collections.get(collectionId);
208206
},
209207
/**
210208
* Get a list of collections;
@@ -218,9 +216,7 @@ export default {
218216

219217
if (!siteId) return [];
220218

221-
const response = await webflow.collections.list({
222-
siteId: siteId,
223-
});
219+
const response = await webflow.collections.list(siteId);
224220
return response?.collections;
225221
},
226222
/**
@@ -235,9 +231,7 @@ export default {
235231

236232
if (!collectionId) return [];
237233

238-
const response = await webflow.collections.items.listItems({
239-
collectionId,
240-
}, {
234+
const response = await webflow.collections.items.listItems(collectionId, {
241235
limit: constants.LIMIT,
242236
offset: page,
243237
});

0 commit comments

Comments
 (0)