8032-devToTest_2440 #3009

Merged
alexm merged 262 commits from 8032-devToTest_2440 into test 2024-09-24 09:34:49 +00:00
4 changed files with 3 additions and 3 deletions
Showing only changes of commit 36cf6b1aee - Show all commits

View File

@ -10,7 +10,6 @@ module.exports = Self => {
require('../methods/account/logout')(Self);
require('../methods/account/change-password')(Self);
require('../methods/account/set-password')(Self);
require('../methods/account/handle-user')(Self);
Self.setUnverifiedPassword = async(id, pass, options) => {
const {emailVerified} = await models.VnUser.findById(id, {fields: ['emailVerified']}, options);

View File

@ -1,6 +1,6 @@
const {models} = require('vn-loopback/server/server');
describe('Account handleUser()', () => {
describe('Device handleUser()', () => {
const ctx = {req: {accessToken: {userId: 9}}};
it('should return data from user', async() => {
@ -9,7 +9,7 @@ describe('Account handleUser()', () => {
const nameApp = 'warehouse';
const versionApp = '10';
const data = await models.Account.handleUser(ctx, androidId, deviceId, versionApp, nameApp);
const data = await models.Device.handleUser(ctx, androidId, deviceId, versionApp, nameApp);
expect(data.numberOfWagons).toBe(2);
});

View File

@ -1,6 +1,7 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
require('../methods/device/handle-user')(Self);
Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY')
return new UserError(``);