Merge pull request #9594 from bergquist/datasources_optimistic_concurrency

datasources: change to optimistic concurrency
This commit is contained in:
Carl Bergquist
2017-10-25 12:44:36 +02:00
committed by GitHub
8 changed files with 200 additions and 73 deletions

View File

@@ -150,13 +150,15 @@ export class DataSourceEditCtrl {
}
if (this.current.id) {
return this.backendSrv.put('/api/datasources/' + this.current.id, this.current).then(() => {
return this.backendSrv.put('/api/datasources/' + this.current.id, this.current).then((result) => {
this.current = result.datasource;
this.updateFrontendSettings().then(() => {
this.testDatasource();
});
});
} else {
return this.backendSrv.post('/api/datasources', this.current).then(result => {
this.current = result.datasource;
this.updateFrontendSettings();
datasourceCreated = true;