fix(xo-server#removeSubjectToResourceSet): rename to removeSubjectFromResourceSet (#5266)
This commit is contained in:
parent
3a0cc0d6f6
commit
4575b98fd5
@ -17,6 +17,7 @@
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [Import VMDK] Fix `No position specified for vmdisk1` error (PR [#5255](https://github.com/vatesfr/xen-orchestra/pull/5255))
|
||||
- [API] Fix `this.removeSubjectFromResourceSet is not a function` error on calling `resourceSet.removeSubject` via `xo-cli` [#5265](https://github.com/vatesfr/xen-orchestra/issues/5265) (PR [#5266](https://github.com/vatesfr/xen-orchestra/pull/5266))
|
||||
|
||||
### Packages to release
|
||||
|
||||
@ -37,3 +38,4 @@
|
||||
|
||||
- xo-vmdk-to-vhd patch
|
||||
- xo-web minor
|
||||
- xo-server patch
|
||||
|
@ -109,6 +109,12 @@ class XoConnection extends Xo {
|
||||
return id
|
||||
}
|
||||
|
||||
async createTempResourceSet(params) {
|
||||
const { id } = await xo.call('resourceSet.create', params)
|
||||
this._tempResourceDisposers.push('resourceSet.delete', { id })
|
||||
return id
|
||||
}
|
||||
|
||||
async getUser(id) {
|
||||
return find(await super.call('user.getAll'), { id })
|
||||
}
|
||||
|
@ -115,4 +115,24 @@ describe('issue', () => {
|
||||
expect(vm.boot.order).toBe('n' + bootOrder)
|
||||
})
|
||||
})
|
||||
|
||||
describe('5265', () => {
|
||||
const rsName = "xo-server-test resource set"
|
||||
const subjects = [
|
||||
'one',
|
||||
'two',
|
||||
'three',
|
||||
]
|
||||
test('resourceSet.removeSubject call', async () => {
|
||||
const id = await xo.createTempResourceSet({
|
||||
name: rsName,
|
||||
subjects: subjects,
|
||||
})
|
||||
|
||||
await xo.call('resourceSet.removeSubject', {
|
||||
id,
|
||||
subject: subjects[0]
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -307,7 +307,7 @@ export default class {
|
||||
await this._save(set)
|
||||
}
|
||||
|
||||
async removeSubjectToResourceSet(subjectId, setId) {
|
||||
async removeSubjectFromResourceSet(subjectId, setId) {
|
||||
const set = await this.getResourceSet(setId)
|
||||
remove(set.subjects, id => id === subjectId)
|
||||
await this._save(set)
|
||||
|
Loading…
Reference in New Issue
Block a user