Skip to content

Commit

Permalink
Log file document saved
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Naulleau committed Dec 6, 2024
1 parent 6276b48 commit 35b7974
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { DrizzleTransactionableAsync } from 'src/shared-kernel/adapters/secondar
import { filesPm } from './schema/files-pm';

export class SqlFileRepository implements FileRepository {
save(report: FileDocument): DrizzleTransactionableAsync {
save(file: FileDocument): DrizzleTransactionableAsync {
return async (db) => {
const reportRow = SqlFileRepository.mapToDb(report);
const reportRow = SqlFileRepository.mapToDb(file);
await db.insert(filesPm).values(reportRow);
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export class UploadFileUseCase {
filePath,
FilesStorageProvider.SCALEWAY,
);
console.log('files context - created file document');
console.log(
'files context - created file document',
fileDocument,
fileDocument.toSnapshot(),
);

// Order matters, file isn't uploaded if saving in repository fails
await this.fileRepository.save(fileDocument)(trx);
Expand Down

0 comments on commit 35b7974

Please sign in to comment.