PROCEED-Labs / proceed

Business Process Management System
MIT License
5 stars 9 forks source link

Ms2/user error helper #340

Closed FelipeTrost closed 2 weeks ago

FelipeTrost commented 4 months ago

Summary

Wrapper for server actions that deals with errors (thrown errors and UserError responses from the server) and gives users feedback.

Examples

Basic example

wrapServerCall({
        fn: () => updateUser(values),
        onSuccess: "Profile updated"
});

Custom logic

wrapServerCall({
        fn: () => updateUser(values),
        onSuccess: (user) => {
            setUser(user);
            // now you have to give feedback on your own
            app.notification.success({ message: 'Profile updated'})
        }
});

Disable feedback

wrapServerCall({
        fn: () => updateUser(values),
        onSuccess: false
        onError: false,
});
github-actions[bot] commented 4 months ago

CLOUDRUN ACTIONS

✅ Successfully created Preview Deployment.

https://pr-340---ms-server-staging-c4f6qdpj7q-ew.a.run.app

github-actions[bot] commented 3 months ago

CLOUDRUN ACTIONS

✅ Successfully created Preview Deployment.

https://pr-340---ms-server-staging-c4f6qdpj7q-ew.a.run.app

github-actions[bot] commented 3 months ago

CLOUDRUN ACTIONS

✅ Successfully created Preview Deployment.

https://pr-340---ms-server-staging-c4f6qdpj7q-ew.a.run.app

github-actions[bot] commented 1 month ago

CLOUDRUN ACTIONS

✅ Successfully created Preview Deployment.

https://pr-340---ms-server-staging-c4f6qdpj7q-ew.a.run.app

github-actions[bot] commented 1 month ago

CLOUDRUN ACTIONS

✅ Successfully created Preview Deployment.

https://pr-340---ms-server-staging-c4f6qdpj7q-ew.a.run.app

github-actions[bot] commented 4 weeks ago

CLOUDRUN ACTIONS

✅ Successfully created Preview Deployment.

https://pr-340---ms-server-staging-c4f6qdpj7q-ew.a.run.app