export async function createGroup()

in src/Frontend/src/services/group.ts [54:70]


export async function createGroup(data : any) : Promise<IGroupResponse> {
    return new Promise<IGroupResponse>(async (resolve, reject) => {
        try {
            await api.post(ENDPOINT_GROUPS, data).then(response => {         
                AlertInstance.alert(ALERT_SUCCESS, 'toast.success.form.group_created');
                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);
        }
    });
}