Get data from the database

PHOTO EMBED

Sat Mar 26 2022 12:09:36 GMT+0000 (UTC)

Saved by @mmzaghlool52 #markdown

import {DataTypes} from 'nodejs-express-utils';
import ContactUs from '../models/ContactUs';

// Get data from the database
const extraQuery = 'WHERE timestamp=:timestamp';
const params = {timestamp: 1631318513};
const fields = ['id', 'body'];

ContactUs.get(extraQuery, params, fields)
    .then((res) => console.log(res))
    .catch((err) => console.error(err));
content_copyCOPY