Skip to content

Commit ee05dbf

Browse files
author
Ben White
committed
Resolve Typescript incompatible types error for feedGeneratorId
1 parent 2b88db5 commit ee05dbf

File tree

2 files changed

+5
-1
lines changed
  • src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/workspaces/details

2 files changed

+5
-1
lines changed

src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/workspaces/details/context.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,15 @@ export class UcpfDetailsWorkspaceContext
9999

100100
protected resetState(): void {
101101
super.resetState();
102+
103+
const availableFeedTypes = this.#feedTypes.getValue();
104+
102105
this.#unique.setValue('');
103106
this.#model.setValue({
104107
feedDescription: '',
105108
storeId: this.#store!.id,
106109
feedName: '',
110+
feedGeneratorId: availableFeedTypes.length > 0 ? availableFeedTypes[0] : '',
107111
feedRelativePath: '',
108112
productChildVariantTypeIds: [],
109113
productDocumentTypeIds: [],

src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/workspaces/details/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export type FeProductFeedSettingWriteModel = Omit<ProductFeedSettingWriteModel,
44
id?: string
55
propertyNameMappings: Array<FePropertyAndNodeMapDetails>
66
productRootId?: string,
7-
feedGeneratorId?: string
7+
feedGeneratorId: string
88
}
99

1010
export type FePropertyAndNodeMapDetails = PropertyAndNodeMapItem & {

0 commit comments

Comments
 (0)