Migration Improvements (#47)

Make "migration" "import everywhere"

Add checking for migration status before trying to migrate

Add get status from migrations

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/47
This commit is contained in:
konrad 2020-01-20 21:22:32 +00:00
parent 9b232c7d4f
commit d61a7511da
4 changed files with 50 additions and 9 deletions

View file

@ -282,9 +282,21 @@ export default class AbstractService {
return Promise.reject({message: 'This model is not able to get data.'})
}
return this.getM(this.paths.get, model, params)
}
/**
* This is a more abstract implementation which only does a get request.
* Services which need more flexibility can use this.
* @param url
* @param model
* @param params
* @returns {Q.Promise<unknown>}
*/
getM(url, model = {}, params = {}) {
const cancel = this.setLoading()
model = this.beforeGet(model)
return this.http.get(this.getReplacedRoute(this.paths.get, model), {params: params})
return this.http.get(this.getReplacedRoute(url, model), {params: params})
.catch(error => {
return this.errorHandler(error)
})