cooking
Some checks failed
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Failing after 0s

This commit is contained in:
BOTAlex 2025-08-14 07:03:57 +02:00
parent 1b371ff2b7
commit 990266de0c
2 changed files with 23 additions and 4 deletions

View file

@ -3,6 +3,7 @@ import { ParseAssetUrl } from "@src/ts/Helper";
export class ShopItem {
item_name: string;
short_desc: string;
preview_image: string;
page_url: string; // the url used for the item
images_root: string; // might not be optimal to include this, in the same class, but should be fine, for now at least
@ -13,6 +14,7 @@ export class ShopItem {
constructor(
item_name: string,
short_desc: string,
preview_image: string,
redirect: string,
images_root: string,
@ -22,6 +24,7 @@ export class ShopItem {
unlisted: boolean,
) {
this.item_name = item_name;
this.short_desc = short_desc;
this.preview_image = preview_image;
this.page_url = redirect;
this.images_root = images_root;
@ -34,6 +37,7 @@ export class ShopItem {
static fromJSON(json: any): ShopItem {
return new ShopItem(
json.item_name,
json.short_desc,
ParseAssetUrl(json.preview_image, "/assets/shop/preview-images"),
json.page_url,
ParseAssetUrl(json.images_root, "/assets/shop/" + json.item_name + "/"), // Please use better paths