postgresql: fix clear route to have username and remove extra }

This commit is contained in:
Girish Ramakrishnan
2018-09-17 19:38:26 -07:00
parent bcee0aa2ad
commit 1b205ac107
+1 -1
View File
@@ -688,7 +688,7 @@ function clearPostgreSql(app, options, callback) {
getAddonDetails('postgresql', 'CLOUDRON_POSTGRESQL_TOKEN', function (error, result) {
if (error) return callback(error);
request.delete(`https://${result.ip}:3000/databases/db${appId}/clear?access_token=${result.token}}`, { rejectUnauthorized: false }, function (error, response, body) {
request.post(`https://${result.ip}:3000/databases/db${appId}/clear?access_token=${result.token}&username=user${appId}`, { rejectUnauthorized: false }, function (error, response, body) {
if (error) return callback(new Error('Error clearing postgresql: ' + error));
if (response.statusCode !== 200) return callback(new Error(`Error clearing postgresql. Status code: ${response.statusCode}`));