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

Function onSaveClick

web/pgadmin/static/js/UtilityView.jsx:96–109  ·  view source on GitHub ↗
(isNew, data)

Source from the content-addressed store, hash-verified

94
95 /* on save button callback, promise required */
96 const onSaveClick = (isNew, data)=>new Promise((resolve, reject)=>{
97 return api({
98 url: url(),
99 method: isNew ? 'POST' : 'PUT',
100 data: {...data, ...extraData},
101 }).then((res)=>{
102 /* Don't warn the user before closing dialog */
103 resolve(res.data);
104 onSave?.(res.data, data);
105 onClose();
106 }).catch((err)=>{
107 reject(err instanceof Error ? err : Error(gettext('Something went wrong')));
108 });
109 });
110
111 /* Called when switched to SQL tab, promise required */
112 const getSQLValue = (isNew, changedData)=>{

Callers

nothing calls this directly

Calls 4

gettextFunction · 0.85
urlFunction · 0.70
onCloseFunction · 0.70
onSaveFunction · 0.50

Tested by

no test coverage detected