mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Allow users to convert View/Edit table into a Query tool to enable editing the SQL generated. #5908
This commit is contained in:
@@ -13,6 +13,12 @@ const usePreferences = create((set, get)=>({
|
||||
get().data, {'module': module, 'name': preference}
|
||||
);
|
||||
},
|
||||
setPreference: (data)=> {
|
||||
// Update Preferences and then refresh cache.
|
||||
getApiInstance().put(url_for('preferences.update_pref'), data).then(()=> {
|
||||
preferenceChangeBroadcast.postMessage('refresh');
|
||||
});
|
||||
},
|
||||
getPreferencesForModule: function(module) {
|
||||
let preferences = {};
|
||||
_.forEach(
|
||||
@@ -62,6 +68,9 @@ export function setupPreferenceBroadcast() {
|
||||
if(ev.data == 'sync') {
|
||||
broadcast(usePreferences.getState());
|
||||
}
|
||||
if(ev.data == 'refresh') {
|
||||
usePreferences.getState().cache();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user