2020-01-19 20:23:06 +01:00
|
|
|
import AbstractService from '../abstractService'
|
|
|
|
|
|
|
|
// This service builds on top of the abstract service and basically just hides away method names.
|
|
|
|
// It enables migration services to be created with minimal overhead and even better method names.
|
|
|
|
export default class AbstractMigrationService extends AbstractService {
|
2020-01-20 22:22:32 +01:00
|
|
|
serviceUrlKey = ''
|
|
|
|
|
2020-01-19 20:23:06 +01:00
|
|
|
constructor(serviceUrlKey) {
|
|
|
|
super({
|
2020-09-05 22:35:52 +02:00
|
|
|
update: '/migration/' + serviceUrlKey + '/migrate',
|
2020-01-19 20:23:06 +01:00
|
|
|
})
|
2020-01-20 22:22:32 +01:00
|
|
|
this.serviceUrlKey = serviceUrlKey
|
2020-01-19 20:23:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
getAuthUrl() {
|
2020-09-05 22:35:52 +02:00
|
|
|
return this.getM('/migration/' + this.serviceUrlKey + '/auth')
|
2020-01-20 22:22:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
getStatus() {
|
2020-09-05 22:35:52 +02:00
|
|
|
return this.getM('/migration/' + this.serviceUrlKey + '/status')
|
2020-01-19 20:23:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
migrate(data) {
|
|
|
|
return this.update(data)
|
|
|
|
}
|
|
|
|
}
|