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

Function getSQLValue

web/pgadmin/static/js/UtilityView.jsx:112–126  ·  view source on GitHub ↗
(isNew, changedData)

Source from the content-addressed store, hash-verified

110
111 /* Called when switched to SQL tab, promise required */
112 const getSQLValue = (isNew, changedData)=>{
113 const msqlUrl = extraData?.msqlurl ? extraData.msqlurl: generateNodeUrl.call(nodeObj, treeNodeInfo, 'msql', itemNodeData, !isNew, nodeObj.url_jump_after_node);
114 return new Promise((resolve, reject)=>{
115 api({
116 url: msqlUrl,
117 method: 'GET',
118 params: changedData,
119 }).then((res)=>{
120 resolve(res.data.data);
121 }).catch((err)=>{
122 onError(err);
123 reject(err instanceof Error ? err : Error(gettext('Something went wrong')));
124 });
125 });
126 };
127
128 /* Callback for help button */
129 const onHelp = (isSqlHelp=false)=>{

Callers

nothing calls this directly

Calls 2

gettextFunction · 0.85
onErrorFunction · 0.70

Tested by

no test coverage detected