From 806dcb18adc01a2e3e7d8b808d8dbe8129c966bf Mon Sep 17 00:00:00 2001 From: Xen0Xys Date: Wed, 22 May 2024 18:27:02 +0200 Subject: [PATCH] :bug: Fix migration url --- src/modules/webtoon/migration/migration.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/webtoon/migration/migration.service.ts b/src/modules/webtoon/migration/migration.service.ts index 15005ae..6a803da 100644 --- a/src/modules/webtoon/migration/migration.service.ts +++ b/src/modules/webtoon/migration/migration.service.ts @@ -17,7 +17,7 @@ export class MigrationService{ async migrateFrom(url: string, adminKey: string){ // Get migration infos using axios from the url - const response = await axios.get(url, { + const response = await axios.get(url + "/api/v1/migration/infos", { headers: { "Authorization": adminKey } @@ -25,7 +25,7 @@ export class MigrationService{ const migrationInfos: MigrationInfosResponse = response.data; // Migrate the data for(let i = 1; i <= migrationInfos.chunkNumber; i++){ - const imageZipBuffer: Buffer = await this.downloadFile(`${url}/images?chunk=${i}`, adminKey); + const imageZipBuffer: Buffer = await this.downloadFile(`${url}/api/v1/migration/images?chunk=${i}`, adminKey); const imageZip: JSZip = await JSZip.loadAsync(imageZipBuffer); const images: Record = {}; for(const [fileName, file] of Object.entries(imageZip.files)) @@ -35,7 +35,7 @@ export class MigrationService{ } // Database migration await this.prismaService.onModuleDestroy(); - const databaseBuffer: Buffer = await this.downloadFile(`${url}/database`, adminKey); + const databaseBuffer: Buffer = await this.downloadFile(`${url}/api/v1/migration/database`, adminKey); fs.writeFileSync("./prisma/database.db", databaseBuffer); await this.prismaService.onModuleInit(); }