MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / onDeleteClick

Function onDeleteClick

web/pgadmin/tools/user_management/static/js/Roles.jsx:83–96  ·  view source on GitHub ↗
(row)

Source from the content-addressed store, hash-verified

81 const pgAdmin = usePgAdmin();
82
83 const onDeleteClick = (row) => {
84 pgAdmin.Browser.notifier.confirm(gettext('Delete Role'), gettext('Are you sure you want to delete the role %s?', row.original.name),
85 async () => {
86 setLoading(gettext('Deleting role...'));
87 try {
88 await api.delete(url_for('user_management.role_delete', { id: row.original.id }));
89 pgAdmin.Browser.notifier.success(gettext('Role deleted successfully.'));
90 updateRoles();
91 } catch (error) {
92 pgAdmin.Browser.notifier.errorText(parseApiError(error));
93 }
94 setLoading('');
95 });
96 };
97
98 const onEditClick = (row) => {
99 const role = row.original;

Callers

nothing calls this directly

Calls 6

parseApiErrorFunction · 0.90
gettextFunction · 0.85
confirmMethod · 0.80
successMethod · 0.80
errorTextMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected