This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementById("loginForm").addEventListener("submit", function(event) { | |
event.preventDefault(); // prevent form from reloading page | |
const email = document.getElementById("email").value.trim(); | |
const password = document.getElementById("password").value.trim(); | |
const errorMsg = document.getElementById("error-msg"); | |
if (!email || !password) { | |
errorMsg.textContent = "Both fields are required."; | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Juice Shop Login</title> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
background-color: #f2f2f2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.4; | |
import "../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "../node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "../node_modules/@openzeppelin/contracts/access/Ownable.sol"; | |
import "../node_modules/@openzeppelin/contracts/utils/Counters.sol"; | |
contract WarrantyNFT is ERC721, ERC721URIStorage, Ownable { | |
using Counters for Counters.Counter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = createCoreController("api::order.order", ({ strapi }) => ({ | |
async create(ctx) { | |
const { products } = ctx.request.body; | |
try { | |
const lineItems = await Promise.all( | |
products.map(async (product) => { | |
const item = await strapi | |
.service("api::product.product") | |
.findOne(product.id); | |
// this item comes from our db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
module.exports = ({ env }) => { | |
const client = env('DATABASE_CLIENT', 'sqlite'); | |
const connections = { | |
postgres: { | |
connection: { | |
connectionString: env('DATABASE_URL'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Children } from "react"; | |
import { createBrowserRouter, RouterProvider, Outlet } from "react-router-dom"; | |
import Footer from "./components/Footer/Footer"; | |
import Navbar from "./components/Navbar/Navbar"; | |
import Home from "./pages/Home/Home"; | |
import Product from "./pages/Product/Product"; | |
import Products from "./pages/Products/Products"; | |
import "./app.scss" | |
const Layout = () => { |