This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/services/migrator/abstractMigrationFile.ts
Dominik Pschenitschni 8b7b4d61a3
Some checks failed
continuous-integration/drone/push Build is failing
feat: MigrateService script setup (#2432)
Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: #2432
Reviewed-by: konrad <k@knt.li>
Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
2022-11-03 14:19:42 +00:00

31 lines
727 B
TypeScript

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 AbstractMigrationFileService extends AbstractService {
serviceUrlKey = ''
constructor(serviceUrlKey: string) {
super({
create: '/migration/' + serviceUrlKey + '/migrate',
})
this.serviceUrlKey = serviceUrlKey
}
getStatus() {
return this.getM('/migration/' + this.serviceUrlKey + '/status')
}
useCreateInterceptor() {
return false
}
migrate(file: File) {
return this.uploadFile(
this.paths.create,
file,
'import',
)
}
}