@tomei/product
Version:
NestJS package for product module
41 lines • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductProductCollectionRepository = void 0;
const general_1 = require("@tomei/general");
const product_collection_entity_1 = require("../../entities/product-collection.entity");
class ProductProductCollectionRepository extends general_1.RepositoryBase {
constructor() {
super(product_collection_entity_1.ProductCollectionsModel);
}
async findAndCountAll(options) {
try {
let settingGroups;
if (options) {
settingGroups = await product_collection_entity_1.ProductCollectionsModel.findAndCountAll(options);
}
else {
settingGroups = await product_collection_entity_1.ProductCollectionsModel.findAndCountAll();
}
return settingGroups;
}
catch (error) {
throw new Error(`An Error occured when retriving product collection: ${error.message}`);
}
}
async delete(ProductCollectionId, dbTransaction) {
try {
const options = {
where: {
ProductCollectionId: ProductCollectionId,
},
transaction: dbTransaction,
};
await product_collection_entity_1.ProductCollectionsModel.destroy(options);
}
catch (error) {
throw new Error(`An Error occured when delete product collection: ${error.message}`);
}
}
}
exports.ProductProductCollectionRepository = ProductProductCollectionRepository;
//# sourceMappingURL=product-collection-product.repository.js.map