mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
error flattening, remain to details, and delete old config stuff
This commit is contained in:
committed by
Aiden McClelland
parent
ae09f5a4f2
commit
6a9ec0ea05
@@ -2,6 +2,7 @@ import { Subject, Observable } from 'rxjs'
|
||||
import { Http, Update, Operation, Revision, Source, Store } from 'patch-db-client'
|
||||
import { RR } from '../api.types'
|
||||
import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||
import { RequestError, RPCError } from '../../http.service'
|
||||
|
||||
export abstract class ApiService implements Source<DataModel>, Http<DataModel> {
|
||||
protected readonly sync = new Subject<Update<DataModel>>()
|
||||
@@ -189,10 +190,15 @@ export abstract class ApiService implements Source<DataModel>, Http<DataModel> {
|
||||
// this.sync.next({ patch: [temp], expiredBy: expireId })
|
||||
// }
|
||||
|
||||
return f(a).then(({ response, revision }) => {
|
||||
if (revision) this.sync.next(revision)
|
||||
return response
|
||||
}) as any
|
||||
return f(a)
|
||||
.catch((e: RequestError) => {
|
||||
if (e.revision) this.sync.next(e.revision)
|
||||
throw e
|
||||
})
|
||||
.then(({ response, revision }) => {
|
||||
if (revision) this.sync.next(revision)
|
||||
return response
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user