chore(xo-server/models/Remote): remove save()
This commit is contained in:
parent
809e1a35cd
commit
b966e6097f
@ -22,10 +22,6 @@ export class Remotes extends Collection {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async save (remote) {
|
|
||||||
return /* await */ this.update(remote)
|
|
||||||
}
|
|
||||||
|
|
||||||
async get (properties) {
|
async get (properties) {
|
||||||
const remotes = await super.get(properties)
|
const remotes = await super.get(properties)
|
||||||
forEach(remotes, remote => {
|
forEach(remotes, remote => {
|
||||||
|
@ -21,7 +21,9 @@ export default class {
|
|||||||
'remotes',
|
'remotes',
|
||||||
() => this._remotes.get(),
|
() => this._remotes.get(),
|
||||||
remotes =>
|
remotes =>
|
||||||
Promise.all(mapToArray(remotes, remote => this._remotes.save(remote)))
|
Promise.all(
|
||||||
|
mapToArray(remotes, remote => this._remotes.update(remote))
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
const remotes = await this.getAllRemotes()
|
const remotes = await this.getAllRemotes()
|
||||||
@ -84,7 +86,7 @@ export default class {
|
|||||||
const handler = await this.getRemoteHandler(remote.properties, true)
|
const handler = await this.getRemoteHandler(remote.properties, true)
|
||||||
const props = await handler.sync()
|
const props = await handler.sync()
|
||||||
this._updateRemote(remote, props)
|
this._updateRemote(remote, props)
|
||||||
return (await this._remotes.save(remote)).properties
|
return (await this._remotes.update(remote)).properties
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateRemote (remote, { name, url, enabled, error }) {
|
_updateRemote (remote, { name, url, enabled, error }) {
|
||||||
|
Loading…
Reference in New Issue
Block a user