code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
|
||||
|
||||
import type { ViewDataBuilder } from '@/lib/contracts/builders/ViewDataBuilder';
|
||||
import type { GetMediaOutputDTO } from '@/lib/types/generated/GetMediaOutputDTO';
|
||||
import type { MediaBinaryDTO } from '@/lib/types/MediaBinaryDTO';
|
||||
import type { CategoryIconViewData } from '@/lib/view-data/CategoryIconViewData';
|
||||
import type { GetMediaOutputDTO } from '@/lib/types/generated/GetMediaOutputDTO';
|
||||
|
||||
export class CategoryIconViewDataBuilder {
|
||||
public static build(apiDto: GetMediaOutputDTO): CategoryIconViewData {
|
||||
public static build(apiDto: MediaBinaryDTO): CategoryIconViewData {
|
||||
// Note: GetMediaOutputDTO from OpenAPI doesn't have buffer,
|
||||
// but the implementation expects it for binary data.
|
||||
const binaryDto = apiDto as unknown as { buffer?: ArrayBuffer };
|
||||
@@ -13,9 +14,8 @@ export class CategoryIconViewDataBuilder {
|
||||
|
||||
return {
|
||||
buffer: buffer ? Buffer.from(buffer).toString('base64') : '',
|
||||
contentType: apiDto.type,
|
||||
contentType: (apiDto as any).contentType,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
CategoryIconViewDataBuilder satisfies ViewDataBuilder<GetMediaOutputDTO, CategoryIconViewData>;
|
||||
|
||||
Reference in New Issue
Block a user