improve views in listing
This commit is contained in:
@@ -30,8 +30,11 @@ class PageListing extends HTMLElement {
|
||||
this.listing = await directus.getListing(this.listingId)
|
||||
this.loadFavoriteState()
|
||||
|
||||
// Increment view counter (async, don't wait)
|
||||
directus.incrementListingViews(this.listingId)
|
||||
// Increment view counter and update local state
|
||||
const newViews = await directus.incrementListingViews(this.listingId)
|
||||
if (newViews !== null) {
|
||||
this.listing.views = newViews
|
||||
}
|
||||
|
||||
// Load other listings from same seller
|
||||
if (this.listing?.user_created) {
|
||||
|
||||
Reference in New Issue
Block a user