commit 10deb56a849864c330e41331a5c161f993ecab80
parent 662f07e82a23ed869c3cedd0ddf029a6bb791af2
Author: triesap <137732411+triesap@users.noreply.github.com>
Date: Sat, 12 Apr 2025 18:45:36 +0000
utils-nostr: edit classified event adding price/quantity tags lists
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/utils-nostr/src/lib/tags.ts b/utils-nostr/src/lib/tags.ts
@@ -67,10 +67,10 @@ export const tags_classified = (opts: INostrClassified): NostrEventTags => {
const tags: NostrEventTags = [[`d`, d_tag]];
if (opts.client) tags.push(tag_client(opts.client, opts.d_tag));
for (const [k, v] of Object.entries(listing)) if (v) tags.push([k, v]);
- tags.push(tag_classified_quantity(quantity));
- tags.push(tag_classified_price(price));
+ for (const quantity_tags of quantity) tags.push(tag_classified_quantity(quantity_tags));
+ for (const price_tags of price) tags.push(tag_classified_price(price_tags));
tags.push(tag_classified_location(location));
- if (opts.images) for (const image of opts.images) tags.push(tag_classified_image(image));
+ if (opts.images) for (const image_tags of opts.images) tags.push(tag_classified_image(image_tags));
tags.push(...tags_classified_location_geotags(location));
return tags;
};
\ No newline at end of file
diff --git a/utils-nostr/src/lib/types.ts b/utils-nostr/src/lib/types.ts
@@ -22,8 +22,8 @@ export type INostrFollow = {
export type INostrClassified = {
d_tag: string;
listing: NostrEventTagListing;
- quantity: NostrEventTagQuantity;
- price: NostrEventTagPrice;
+ quantity: NostrEventTagQuantity[];
+ price: NostrEventTagPrice[];
location: NostrEventTagLocation;
images?: NostrEventTagMediaUpload[];
client?: NostrEventTagClient;