Category : postgresql

I am trying to convert js code to ts code (and understanding why something have been done). This my JS code use strict’; const fs = require(‘fs’); const path = require(‘path’); const Sequelize = require(‘sequelize’); const basename = path.basename(__filename); const env = process.env.NODE_ENV || ‘development’; const config = require(__dirname + ‘/../config/config.js’)[env]; const db = {}; ..

Read more

export default function RegistrationForm() { useEffect(() => { const getAPI = () => { const API = ‘http://127.0.0.1:5000/’; fetch(API) .then((response) => { console.log(response); return response.json(); }) .then((data) => { console.log(data); setLoading(false); setApiData(data); }); }; getAPI(); }, []); const [apiData, setApiData] = useState([]); const [loading, setLoading] = useState(true); function verifyPassword() { let pass1 = document.getElementById("password").value; let ..

Read more

How can I emulate the following postgreSql using sequelize? My code: sequelize define: const Order_Product = sequelize.define(‘order_product’, { order_id: { type: DataTypes.INTEGER, references: { model: ‘order’, key: ‘order_id’ } }, product_id: { type: DataTypes.INTEGER, references: { model: ‘product’, key: ‘product_id’ } }, quantity: { type: DataTypes.INTEGER }, un_price: { type: DataTypes.DECIMAL }, total_price: { type: ..

Read more