Skip to content

Commit

Permalink
feat: 创建message支持传递type
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjue666 committed Dec 3, 2024
1 parent ecf3be6 commit 18c1094
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spapi-listing-builder",
"type": "module",
"version": "0.1.8",
"version": "0.1.9",
"packageManager": "[email protected]",
"description": "_description_",
"author": "wangjue666 <[email protected]>",
Expand Down
9 changes: 5 additions & 4 deletions src/feed/product/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ListingProduct } from '@/listing/product'
import type { ProductData, RenderOtherAttributesFn } from '@/help/state'
import type { ListingType, ProductData, RenderOtherAttributesFn } from '@/help/state'
import { FeedHeader } from '../FeedHeader'

export class FeedProduct {
Expand All @@ -14,14 +14,14 @@ export class FeedProduct {
this.renderOtherAttributesFn = renderOtherAttributesFn
}

main() {
main(type?: ListingType) {
return {
header: new FeedHeader(this.sellerId).main(),
messages: this.genMessage(),
messages: this.genMessage(type),
}
}

genMessage() {
genMessage(type?: ListingType) {
return this.list.map((item, idx) => {
return {
messageId: idx + 1,
Expand All @@ -31,6 +31,7 @@ export class FeedProduct {
marketplace_id: this.marketplace_id,
data: item,
renderOtherAttributesFn: this.renderOtherAttributesFn,
type,
}).main(),
}
})
Expand Down

0 comments on commit 18c1094

Please sign in to comment.