Skip to content

Commit

Permalink
run code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
MellyGray committed Jan 25, 2024
1 parent d3a614e commit 847004b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/files/domain/useCases/GetFile.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { IFilesRepository } from "../repositories/IFilesRepository";
import { File } from "../models/File";
import { IFilesRepository } from '../repositories/IFilesRepository';
import { File } from '../models/File';

export class GetFile {
constructor(private readonly filesRepository: IFilesRepository) {}

async execute(fileId: number | string): Promise<File> {
return await this.filesRepository.getFile(fileId);
}
}
}
14 changes: 7 additions & 7 deletions src/files/domain/useCases/GetFileDraft.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { IFilesRepository } from "../repositories/IFilesRepository";
import { File } from "../models/File";
import { IFilesRepository } from '../repositories/IFilesRepository';
import { File } from '../models/File';

export class GetFileDraft {
constructor(private readonly filesRepository: IFilesRepository) {}
constructor(private readonly filesRepository: IFilesRepository) {}

async execute(fileId: number | string): Promise<File> {
return await this.filesRepository.getFileDraft(fileId);
}
}
async execute(fileId: number | string): Promise<File> {
return await this.filesRepository.getFileDraft(fileId);
}
}
6 changes: 3 additions & 3 deletions src/files/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { GetFileDownloadCount } from './domain/useCases/GetFileDownloadCount';
import { GetFileUserPermissions } from './domain/useCases/GetFileUserPermissions';
import { GetFileDataTables } from './domain/useCases/GetFileDataTables';
import { GetDatasetFilesTotalDownloadSize } from './domain/useCases/GetDatasetFilesTotalDownloadSize';
import { GetFile } from "./domain/useCases/GetFile";
import { GetFileDraft } from "./domain/useCases/GetFileDraft";
import { GetFile } from './domain/useCases/GetFile';
import { GetFileDraft } from './domain/useCases/GetFileDraft';

const filesRepository = new FilesRepository();

Expand All @@ -27,7 +27,7 @@ export {
getDatasetFileCounts,
getDatasetFilesTotalDownloadSize,
getFile,
getFileDraft
getFileDraft,
};

export { File, FileEmbargo, FileChecksum } from './domain/models/File';
Expand Down
6 changes: 3 additions & 3 deletions src/files/infra/repositories/FilesRepository.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApiRepository } from '../../../core/infra/repositories/ApiRepository';
import { IFilesRepository } from '../../domain/repositories/IFilesRepository';
import { File } from '../../domain/models/File';
import {transformFileResponseToFile, transformFilesResponseToFiles} from './transformers/fileTransformers';
import { transformFileResponseToFile, transformFilesResponseToFiles } from './transformers/fileTransformers';
import { FileDataTable } from '../../domain/models/FileDataTable';
import { transformDataTablesResponseToDataTables } from './transformers/fileDataTableTransformers';
import { FileUserPermissions } from '../../domain/models/FileUserPermissions';
Expand Down Expand Up @@ -152,10 +152,10 @@ export class FilesRepository extends ApiRepository implements IFilesRepository {
}

public async getFileDraft(fileId: number | string): Promise<File> {
return this.doGet(this.buildApiEndpoint(this.filesResourceName, 'draft', fileId), true)
return this.doGet(this.buildApiEndpoint(this.filesResourceName, 'draft', fileId), true)
.then((response) => transformFileResponseToFile(response))
.catch((error) => {
throw error;
throw error;
});
}

Expand Down
6 changes: 3 additions & 3 deletions src/files/infra/repositories/transformers/fileTransformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export const transformFilesResponseToFiles = (response: AxiosResponse): File[] =
};

export const transformFileResponseToFile = (response: AxiosResponse): File => {
const filePayload = response.data.data;
return transformFilePayloadToFile(filePayload);
}
const filePayload = response.data.data;
return transformFilePayloadToFile(filePayload);
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const transformFilePayloadToFile = (filePayload: any): File => {
Expand Down

0 comments on commit 847004b

Please sign in to comment.