diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html
index be9e81964..b8e64cf28 100644
--- a/modules/ticket/front/sale/index.html
+++ b/modules/ticket/front/sale/index.html
@@ -318,7 +318,7 @@
clear-disabled="true"
suffix="%">
-
+
{
- this.currentWorkerMana = res.data;
- });
}
getUsesMana() {
diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js
index 9da8e6e7c..b36e78893 100644
--- a/modules/ticket/front/sale/index.spec.js
+++ b/modules/ticket/front/sale/index.spec.js
@@ -120,12 +120,10 @@ describe('Ticket', () => {
const expectedAmount = 250;
$httpBackend.expect('GET', 'Tickets/1/getSalesPersonMana').respond(200, expectedAmount);
$httpBackend.expect('GET', 'Sales/usesMana').respond(200);
- $httpBackend.expect('GET', 'WorkerManas/getCurrentWorkerMana').respond(200, expectedAmount);
controller.getMana();
$httpBackend.flush();
expect(controller.edit.mana).toEqual(expectedAmount);
- expect(controller.currentWorkerMana).toEqual(expectedAmount);
});
});
diff --git a/modules/worker/back/methods/worker-mana/getCurrentWorkerMana.js b/modules/worker/back/methods/worker-mana/getCurrentWorkerMana.js
deleted file mode 100644
index fa34af475..000000000
--- a/modules/worker/back/methods/worker-mana/getCurrentWorkerMana.js
+++ /dev/null
@@ -1,26 +0,0 @@
-module.exports = Self => {
- Self.remoteMethodCtx('getCurrentWorkerMana', {
- description: 'Returns the mana of the logged worker',
- accessType: 'READ',
- accepts: [],
- returns: {
- type: 'number',
- root: true
- },
- http: {
- path: `/getCurrentWorkerMana`,
- verb: 'GET'
- }
- });
-
- Self.getCurrentWorkerMana = async ctx => {
- let userId = ctx.req.accessToken.userId;
-
- let workerMana = await Self.app.models.WorkerMana.findOne({
- where: {workerFk: userId},
- fields: 'amount'
- });
-
- return workerMana ? workerMana.amount : 0;
- };
-};
diff --git a/modules/worker/back/methods/worker-mana/specs/getCurrentWorkerMana.spec.js b/modules/worker/back/methods/worker-mana/specs/getCurrentWorkerMana.spec.js
deleted file mode 100644
index 8d626e720..000000000
--- a/modules/worker/back/methods/worker-mana/specs/getCurrentWorkerMana.spec.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const app = require('vn-loopback/server/server');
-
-describe('workerMana getCurrentWorkerMana()', () => {
- it('should get the mana of the logged worker', async() => {
- let mana = await app.models.WorkerMana.getCurrentWorkerMana({req: {accessToken: {userId: 18}}});
-
- expect(mana).toEqual(124);
- });
-
- it('should return 0 if the user doesnt uses mana', async() => {
- let mana = await app.models.WorkerMana.getCurrentWorkerMana({req: {accessToken: {userId: 9}}});
-
- expect(mana).toEqual(0);
- });
-});
diff --git a/modules/worker/back/models/worker-mana.js b/modules/worker/back/models/worker-mana.js
deleted file mode 100644
index 99a0f7694..000000000
--- a/modules/worker/back/models/worker-mana.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = Self => {
- require('../methods/worker-mana/getCurrentWorkerMana')(Self);
-};