feat(#6): Add a basic product page using the db rather than stripe

This commit is contained in:
Josh Creek
2024-10-15 19:20:40 +01:00
parent e666aa95d0
commit 36a8620e70
3 changed files with 52 additions and 20 deletions
+4 -5
View File
@@ -6,12 +6,11 @@
let enablePagination = false;
onMount(async () => {
const response = await fetch('/products');
const response = await fetch('/products?limit=20&offset=0');
const responseJson = await response.json();
products = responseJson.data;
if (responseJson.has_more) {
enablePagination = true;
}
products = responseJson.products;
var count = responseJson.count;
// enablePagination needs to be set to true if there are more than 20 products
});
</script>