You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
885 B

const AppVersion = require("../Model/AppVersion");
const AsyncHandler = require("../Middleware/async");
const ErrorResponse = require("../utils/errorResponse");
const sequelize = require("sequelize");
const { Json } = require("sequelize/lib/utils");
exports.getAppVersion = AsyncHandler(async (req, res, next) => {
try {
const appVersions = await AppVersion.findOne({
where: {
app_name: "POS", // temporary change to MBN
status: 1,
}
});
if (appVersions)
// throw 'Testing Error '
res.status(200).send(JSON.stringify(appVersions));
else return next(new ErrorResponse('No app version of Wholesaler are found', 404));
} catch (e) {
console.log("EE", e)
// return next(new ErrorResponse(e))
res.status(500).send(JSON.stringify(e))
}
});