@@ -68,10 +68,8 @@ const ConnectionPooling: FC<Props> = () => {
68
68
)
69
69
}
70
70
71
- const { project } = poolingConfiguration
72
-
73
71
// for older projects
74
- if ( ! project . pgbouncer_enabled && project . pool_mode == null )
72
+ if ( ! poolingConfiguration . pgbouncer_enabled && poolingConfiguration . pool_mode == null )
75
73
return (
76
74
< Panel
77
75
title = {
@@ -85,7 +83,7 @@ const ConnectionPooling: FC<Props> = () => {
85
83
</ Panel . Content >
86
84
</ Panel >
87
85
)
88
- const formModel = project
86
+ const formModel = poolingConfiguration
89
87
const DB_FIELDS = [ 'db_host' , 'db_name' , 'db_port' , 'db_user' , 'inserted_at' ]
90
88
const connectionInfo = pluckObjectFields ( formModel , DB_FIELDS )
91
89
const BOUNCER_FIELDS = [
@@ -137,15 +135,22 @@ export const PgbouncerConfig: FC<ConfigProps> = observer(
137
135
pool_mode : bouncerInfo . pool_mode || 'transaction' ,
138
136
default_pool_size : bouncerInfo . default_pool_size || '' ,
139
137
ignore_startup_parameters : bouncerInfo . ignore_startup_parameters || '' ,
138
+ pgbouncer_enabled : bouncerInfo . pgbouncer_enabled ,
140
139
} )
141
140
142
141
const updateConfig = async ( updatedConfig : any ) => {
143
142
try {
144
- const response = await patch ( `${ API_URL } /props/pooling/${ projectRef } /config` , updatedConfig )
143
+ const response = await patch ( `${ API_URL } /projects/${ projectRef } /config/pgbouncer` , {
144
+ pgbouncer_enabled : updatedConfig . pgbouncer_enabled ,
145
+ default_pool_size : updatedConfig . default_pool_size ,
146
+ ignore_startup_parameters : updatedConfig . ignore_startup_parameters ,
147
+ pool_mode : updatedConfig . pool_mode ,
148
+ max_client_conn : updatedConfig . max_client_conn ,
149
+ } )
145
150
if ( response . error ) {
146
151
throw response . error
147
152
} else {
148
- setUpdates ( { ...response . project } )
153
+ setUpdates ( { ...response } )
149
154
ui . setNotification ( { category : 'success' , message : 'Successfully saved settings' } )
150
155
}
151
156
} catch ( error : any ) {
0 commit comments