remove description properties from item clone
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
parent
599084a8be
commit
a0ffde8ed1
|
@ -31,7 +31,13 @@ module.exports = Self => {
|
|||
if (!origin)
|
||||
throw new UserError(`That item doesn't exists`);
|
||||
|
||||
origin.itemTag = undefined;
|
||||
origin.description = undefined;
|
||||
origin.image = undefined;
|
||||
origin.comment = undefined;
|
||||
|
||||
const newItem = await Self.create(origin, options);
|
||||
|
||||
let promises = [];
|
||||
|
||||
await cloneTaxes(origin.id, newItem.id, promises, options);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
|
||||
describe('item clone()', () => {
|
||||
fdescribe('item clone()', () => {
|
||||
let nextItemId;
|
||||
|
||||
beforeEach(async() => {
|
||||
|
@ -17,6 +17,10 @@ describe('item clone()', () => {
|
|||
let result = await app.models.Item.clone(itemFk);
|
||||
|
||||
expect(result.id).toEqual(nextItemId);
|
||||
expect(result.image).toBeUndefined();
|
||||
expect(result.itemTag).toBeUndefined();
|
||||
expect(result.comment).toBeUndefined();
|
||||
expect(result.description).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should attempt to clone the given item but give an error as it doesnt exist', async() => {
|
||||
|
|
Loading…
Reference in New Issue