17 lines
656 B
TypeScript
17 lines
656 B
TypeScript
import type { GetMediaOutputDTO } from '@/lib/types/generated/GetMediaOutputDTO';
|
|
import type { SponsorLogoViewData } from '@/lib/view-data/SponsorLogoViewData';
|
|
|
|
import { ViewDataBuilder } from "../../contracts/builders/ViewDataBuilder";
|
|
|
|
export class SponsorLogoViewDataBuilder implements ViewDataBuilder<any, any> {
|
|
build(input: any): any {
|
|
return SponsorLogoViewDataBuilder.build(input);
|
|
}
|
|
|
|
static build(apiDto: GetMediaOutputDTO): SponsorLogoViewData {
|
|
return {
|
|
buffer: (apiDto as any).buffer ? Buffer.from((apiDto as any).buffer).toString('base64') : '',
|
|
contentType: (apiDto as any).contentType || apiDto.type,
|
|
};
|
|
}
|
|
} |