in src/Frontend/src/services/organization.ts [94:111]
export async function deleteOrganizationById(id : string) : Promise<void> {
return new Promise<void>(async (resolve, reject) => {
try {
const url = `${ENDPOINT_ORGANIZATIONS}/${id}`;
await api.delete(url).then(response => {
AlertInstance.alert(ALERT_SUCCESS, 'toast.success.form.organization_deleted');
resolve(response.data);
}).catch((error: any) => {
//AlertInstance.alert(ALERT_ERROR, 'error_api');
if (process.env.NODE_ENV === 'development') console.error('API ERROR: ' + error);
reject(null);
});
} catch (e) {
if (process.env.NODE_ENV === 'development') console.error('PROMISE ERROR: ' + e);
reject(null);
}
});
}