Updated transactions api test
MODIFY
test/api/client/TransactionApi.ts
test/api/client/TransactionApi.ts
@@ -8,15 +8,15 @@ export default class TransactionApi extends CrudApi {
}
public async readById(id) {
- return await super.readById(id, `/v1/api/transactions/${id}?WithUser=true`);
+ return await super.readById(id, `${this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTION, { id })}?WithUser=true`);
}
public async readAllActive(params, paging = TestConstants.DEFAULT_PAGING, ordering = TestConstants.DEFAULT_ORDERING) {
- return await super.readAll({ ...params, Status: 'active' }, paging, ordering, `/v1/api/${ServerRoute.REST_TRANSACTIONS}`);
+ return await super.readAll({ ...params, Status: 'active' }, paging, ordering, this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTIONS));
}
public async readAllCompleted(params, paging = TestConstants.DEFAULT_PAGING, ordering = TestConstants.DEFAULT_ORDERING) {
- return await super.readAll({ ...params, Status: 'completed' }, paging, ordering, `/v1/api/${ServerRoute.REST_TRANSACTIONS}`);
+ return await super.readAll({ ...params, Status: 'completed' }, paging, ordering, this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTIONS));
}
public async readAllInError(params, paging = TestConstants.DEFAULT_PAGING, ordering = TestConstants.DEFAULT_ORDERING) {
@@ -24,7 +24,7 @@ export default class TransactionApi extends CrudApi {
}
public async readAllConsumption(params) {
- return await super.read(params, `/v1/api/transactions/${params.TransactionId}/consumptions?WithUser=true`);
+ return await super.read(params, `${this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTIONS_CONSUMPTION, { id: params.TransactionId })}?WithUser=true`);
}
public async readAllYears(params) {
@@ -32,13 +32,13 @@ export default class TransactionApi extends CrudApi {
}
public async delete(id) {
- return await super.delete(id, '/client/api/TransactionDelete');
+ return await super.delete(id, this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTION, { id }));
}
public async deleteMany(ids) {
return await this._authenticatedApi.send({
method: 'DELETE',
- url: '/client/api/TransactionsDelete',
+ url: this.buildRestEndpointUrl(ServerRoute.REST_TRANSACTIONS),
data: {
transactionsIDs: ids,
}

Updated transactions api test