diff --git a/dictation_server/src/features/files/files.service.spec.ts b/dictation_server/src/features/files/files.service.spec.ts index 7b677bf..ddd9973 100644 --- a/dictation_server/src/features/files/files.service.spec.ts +++ b/dictation_server/src/features/files/files.service.spec.ts @@ -340,7 +340,15 @@ describe('音声ファイルダウンロードURL取得', () => { 'typist-user-external-id', 'typist', ); - const url = `https://saodmsusdev.blob.core.windows.net/account-${accountId}/${userId}`; + const { userId: authorUserId } = await createUser( + source, + accountId, + 'author-user-external-id', + 'author', + 'AUTHOR_ID', + ); + + const url = `https://saodmsusdev.blob.core.windows.net/account-${accountId}/${authorUserId}`; const { audioFileId } = await createTask( source, @@ -379,7 +387,14 @@ describe('音声ファイルダウンロードURL取得', () => { 'other-typist-user-external-id', 'typist', ); - const url = `https://saodmsusdev.blob.core.windows.net/account-${accountId}/${userId}`; + const { userId: authorUserId } = await createUser( + source, + accountId, + 'author-user-external-id', + 'author', + 'AUTHOR_ID', + ); + const url = `https://saodmsusdev.blob.core.windows.net/account-${accountId}/${authorUserId}`; const { audioFileId } = await createTask( source, diff --git a/dictation_server/src/features/files/files.service.ts b/dictation_server/src/features/files/files.service.ts index 94b196e..5d2a04e 100644 --- a/dictation_server/src/features/files/files.service.ts +++ b/dictation_server/src/features/files/files.service.ts @@ -291,7 +291,7 @@ export class FilesService { ); } - const filePath = `${userId}/${file.file_name}`; + const filePath = `${file.owner_user_id}/${file.file_name}`; const isFileExist = await this.blobStorageService.fileExists( accountId, @@ -300,6 +300,7 @@ export class FilesService { ); if (!isFileExist) { + this.logger.log(`filePath:${filePath}`); throw new AudioFileNotFoundError( `Audio file is not exists in blob storage. audio_file_id:${audioFileId}, url:${file.url}, fileName:${file.file_name}`, );