BE-SPAN/services/spcoImportInfoService.js
githubna-ilham b7f9f07963 ADD api test
2024-10-23 15:58:38 +07:00

19 lines
424 B
JavaScript

const { SPCO_IMPORT_INFO } = require("../models");
// Service to get all records
const getAllImportInfo = async (limit, offset) => {
try {
// return await SPCO_IMPORT_INFO.findAll();
return await SPCO_IMPORT_INFO.findAndCountAll({
limit: limit,
offset: offset,
});
} catch (error) {
throw new Error("Error fetching data: " + error.message);
}
};
module.exports = {
getAllImportInfo,
};