travopti/backend/models/getCountryById.js

14 lines
345 B
JavaScript

module.exports = async (dbConn, id) => {
const country = await dbConn.query(
`SELECT countries.id AS country_id,
countries.country AS name,
countries.description,
countries.preview_img
FROM countries
WHERE countries.id = ?`,
[id]
);
return country;
};