export async function updateOrganizationById()

in src/Frontend/src/services/organization.ts [75:92]


export async function updateOrganizationById(id : string, data : z.infer<typeof SchemaEditOrganization>) : Promise<IOrganization> {
    return new Promise<IOrganization>(async (resolve, reject) => {
        try {
            const url = `${ENDPOINT_ORGANIZATIONS}/${id}`;
            await api.patch(url, data).then(response => {         
                AlertInstance.alert(ALERT_SUCCESS, 'toast.success.form.organization_updated');
                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);
        }
    });
}