Merge branch 'develop' of https://gitlab.com/empatnusabangsa/ppob/ppob-frontend into develop
This commit is contained in:
@@ -52,9 +52,19 @@ export const SupplierComponent = observer((props) => {
|
||||
setIdData(data.id);
|
||||
};
|
||||
|
||||
const changeStatus = (id, isActive) => {
|
||||
const changeStatus = async (id, isActive) => {
|
||||
const status = isActive ? "inactive" : "active";
|
||||
store.supplier.changeStatus(id, status);
|
||||
const status2 = isActive ? "Inactivating" : "Activating";
|
||||
try {
|
||||
const response = await store.supplier.changeStatus(id, status);
|
||||
|
||||
response?.body?.statusCode === 201
|
||||
? message.success(`Success ${status2} Supplier`)
|
||||
: message.error(`Failed ${status2} Supplier`);
|
||||
} catch (err) {
|
||||
console.log("error", err);
|
||||
message.error(`Failed ${status2} Supplier`);
|
||||
}
|
||||
};
|
||||
|
||||
const columns = [
|
||||
|
||||
Reference in New Issue
Block a user