progress
Some checks failed
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Failing after 0s
Some checks failed
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Failing after 0s
This commit is contained in:
parent
a20a3b9cdc
commit
f4453bb8fb
2 changed files with 13 additions and 2 deletions
|
|
@ -1,5 +1,9 @@
|
|||
<script>
|
||||
<script lang="ts">
|
||||
import { onMount } from "svelte";
|
||||
|
||||
onMount(async () => {
|
||||
console.log(window.location.href);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>Baller</div>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import PocketBase from "pocketbase";
|
||||
import { ShopItem } from "./classes/ShopItem";
|
||||
import { PUBLIC_POCKET_URL, PUBLIC_ASSETS_URL_BASE } from "$env/static/public";
|
||||
import { PUBLIC_POCKET_URL, PUBLIC_URL_BASE } from "$env/static/public";
|
||||
|
||||
export let pb = new PocketBase(PUBLIC_POCKET_URL);
|
||||
|
||||
|
|
@ -15,4 +15,11 @@ export class ApiService {
|
|||
const list = await pb.collection("shopItems").getList(1, 50, {});
|
||||
return list.items.map((rec: any) => ShopItem.fromJSON(rec));
|
||||
}
|
||||
|
||||
static async GetShopItemFromUrlPath(url: string): Promise<ShopItem> {
|
||||
const item = await pb
|
||||
.collection("shopItems")
|
||||
.getFirstListItem(`product_url="${url}"`);
|
||||
return ShopItem.fromJSON(item);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue