feat: add set status supplier endpoint
This commit is contained in:
@@ -113,6 +113,22 @@ export class SupplierService {
|
||||
return supplierData;
|
||||
}
|
||||
|
||||
setStatus = async (id: string, type: string) => {
|
||||
const supplierData = new Supplier();
|
||||
|
||||
if (type === 'active') {
|
||||
supplierData.status = true;
|
||||
} else {
|
||||
supplierData.status = false;
|
||||
}
|
||||
|
||||
await this.connection.transaction(async (manager) => {
|
||||
await manager.update(Supplier, { id: id }, supplierData);
|
||||
});
|
||||
|
||||
return supplierData;
|
||||
};
|
||||
|
||||
findAllSupplier(page) {
|
||||
return this.supplierRepository.findAndCount({
|
||||
skip: page * 10,
|
||||
|
||||
Reference in New Issue
Block a user