Skip to content

Commit f0dfa9d

Browse files
committed
fixed client issues with new Para version
1 parent d80833e commit f0dfa9d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ export default class ParaClient {
11451145
fn(null);
11461146
return resolve(null);
11471147
}
1148-
var url = obj.getObjectURI() + '/links/';
1148+
var url = obj.getObjectURI() + '/links';
11491149
return this.getEntity(this.invokeDelete(url), fn);
11501150
}
11511151
/**
@@ -1480,7 +1480,7 @@ export default class ParaClient {
14801480
* @returns {Promise} a map containing all validation constraints.
14811481
*/
14821482
async validationConstraints(type, fn) {
1483-
return this.getEntity(this.invokeGet('_constraints/' + urlEncode(type || '')), fn);
1483+
return this.getEntity(this.invokeGet('_constraints' + (type ? '/' + urlEncode(type) : '')), fn);
14841484
}
14851485
/**
14861486
* Add a new constraint for a given field.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/integration/para-client.spec.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import lodash from 'lodash';
2121
import assert, { strictEqual, notEqual } from 'assert';
22-
import { GenericContainer } from 'testcontainers';
22+
import { GenericContainer, Wait } from 'testcontainers';
2323
import ParaClient from '../../lib/index.js';
2424
import ParaObject from '../../lib/ParaObject.js';
2525
import Pager from '../../lib/Pager.js';
@@ -73,6 +73,7 @@ describeIntegration('ParaClient tests', function () {
7373
: PARA_ACCESS_KEY;
7474
paraContainer = await new GenericContainer(PARA_IMAGE)
7575
.withEnvironment({ para_root_secret_override: PARA_SECRET_KEY })
76+
.withWaitStrategy(Wait.forLogMessage("Started ParaServer"))
7677
.withExposedPorts(8080)
7778
.start();
7879
PARA_BASE_URL = `http://${paraContainer.getHost()}:${paraContainer.getMappedPort(8080)}`;
@@ -209,7 +210,7 @@ describeIntegration('ParaClient tests', function () {
209210
})
210211
.then(function (res) {
211212
pc.read(tr.getType(), tr.getId()).then(
212-
function (res) {},
213+
function (res) { },
213214
function (err) {
214215
done();
215216
}
@@ -1078,7 +1079,7 @@ describeIntegration('ParaClient tests', function () {
10781079
.then(function (res) {
10791080
return pc.appSettings('prop3');
10801081
})
1081-
.then(function (res) {})
1082+
.then(function (res) { })
10821083
.then(function (res) {
10831084
return pc.removeAppSetting('prop1');
10841085
})

0 commit comments

Comments
 (0)