fix issues in core
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
export interface UploadOptions {
|
||||
filename: string;
|
||||
mimeType: string;
|
||||
metadata?: Record<string, any>;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface UploadResult {
|
||||
|
||||
@@ -33,11 +33,11 @@ describe('DeleteMediaUseCase', () => {
|
||||
mediaRepo = {
|
||||
findById: vi.fn(),
|
||||
delete: vi.fn(),
|
||||
} as unknown as IMediaRepository as any;
|
||||
};
|
||||
|
||||
mediaStorage = {
|
||||
deleteMedia: vi.fn(),
|
||||
} as unknown as MediaStoragePort as any;
|
||||
};
|
||||
|
||||
logger = {
|
||||
debug: vi.fn(),
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('GetAvatarUseCase', () => {
|
||||
avatarRepo = {
|
||||
findActiveByDriverId: vi.fn(),
|
||||
save: vi.fn(),
|
||||
} as unknown as IAvatarRepository as any;
|
||||
};
|
||||
|
||||
logger = {
|
||||
debug: vi.fn(),
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('GetMediaUseCase', () => {
|
||||
beforeEach(() => {
|
||||
mediaRepo = {
|
||||
findById: vi.fn(),
|
||||
} as unknown as IMediaRepository as any;
|
||||
};
|
||||
|
||||
logger = {
|
||||
debug: vi.fn(),
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface GetMediaResult {
|
||||
type: string;
|
||||
uploadedBy: string;
|
||||
uploadedAt: Date;
|
||||
metadata?: Record<string, any>;
|
||||
metadata?: Record<string, unknown>;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface MulterFile {
|
||||
export interface UploadMediaInput {
|
||||
file: MulterFile;
|
||||
uploadedBy: string;
|
||||
metadata?: Record<string, any>;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface UploadMediaResult {
|
||||
@@ -60,7 +60,11 @@ export class UploadMediaUseCase {
|
||||
|
||||
try {
|
||||
// Upload file to storage service
|
||||
const uploadOptions: { filename: string; mimeType: string; metadata?: Record<string, any> } = {
|
||||
const uploadOptions: {
|
||||
filename: string;
|
||||
mimeType: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
} = {
|
||||
filename: input.file.originalname,
|
||||
mimeType: input.file.mimetype,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user