Skip to content

Commit 2ae487c

Browse files
Fixed term move issue
1 parent 4327823 commit 2ae487c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/entity.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ export const move = (http, type, force = false, params = {}) => {
313313
try {
314314
let updateData = {}
315315
const json = cloneDeep(this)
316-
delete json.parent_uid
317316
if (type) {
318317
updateData[type] = json
319318
} else {
@@ -328,7 +327,7 @@ export const move = (http, type, force = false, params = {}) => {
328327
if (force === true) {
329328
headers.params.force = true
330329
}
331-
const response = await http.put(`${this.urlPath}/move`, updateData, headers)
330+
const response = await http.put(`${this.urlPath}/move`, param, headers)
332331
if (response.data) {
333332
return new this.constructor(http, parseData(response, this.stackHeaders, this.content_type_uid, this.taxonomy_uid, http))
334333
} else {

test/sanity-check/api/terms-test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,14 @@ describe('Terms API Test', () => {
135135
})
136136

137137
it('should move the term to parent uid passed', done => {
138-
makeTerms(taxonomy.uid, childTerm2.term.uid).fetch()
138+
const term = {
139+
parent_uid: 'term_test_child1',
140+
order: 1
141+
}
142+
makeTerms(taxonomy.uid, childTerm2.term.uid).move({ term, force: true })
139143
.then(async (term) => {
140-
term.parent_uid = null
141-
const moveTerm = await term.move({ force: true })
142-
expect(moveTerm.parent_uid).to.be.equal(null)
144+
expect(term.parent_uid).to.not.equal(null)
143145
done()
144-
return moveTerm
145146
})
146147
.catch(done)
147148
})

0 commit comments

Comments
 (0)