User Data Export and import (#699)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/699 Co-authored-by: konrad <k@knt.li> Co-committed-by: konrad <k@knt.li>
This commit is contained in:
31
src/services/migrator/abstractMigrationFile.js
Normal file
31
src/services/migrator/abstractMigrationFile.js
Normal file
@ -0,0 +1,31 @@
|
||||
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) {
|
||||
super({
|
||||
create: '/migration/' + serviceUrlKey + '/migrate',
|
||||
})
|
||||
this.serviceUrlKey = serviceUrlKey
|
||||
}
|
||||
|
||||
getStatus() {
|
||||
return this.getM('/migration/' + this.serviceUrlKey + '/status')
|
||||
}
|
||||
|
||||
useCreateInterceptor() {
|
||||
return false
|
||||
}
|
||||
|
||||
migrate(file) {
|
||||
console.log(file)
|
||||
return this.uploadFile(
|
||||
this.paths.create,
|
||||
file,
|
||||
'import',
|
||||
)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user