view data fixes
This commit is contained in:
@@ -1,12 +1,5 @@
|
||||
/**
|
||||
* SponsorLogoViewDataBuilder
|
||||
*
|
||||
* Transforms MediaBinaryDTO into SponsorLogoViewData for server-side rendering.
|
||||
* Deterministic; side-effect free; no HTTP calls.
|
||||
*/
|
||||
|
||||
import { MediaBinaryDTO } from '@/lib/types/MediaBinaryDTO';
|
||||
import { SponsorLogoViewData } from '@/lib/view-data/SponsorLogoViewData';
|
||||
import type { GetMediaOutputDTO } from '@/lib/types/generated/GetMediaOutputDTO';
|
||||
import type { SponsorLogoViewData } from '@/lib/view-data/SponsorLogoViewData';
|
||||
|
||||
import { ViewDataBuilder } from "../../contracts/builders/ViewDataBuilder";
|
||||
|
||||
@@ -15,11 +8,10 @@ export class SponsorLogoViewDataBuilder implements ViewDataBuilder<any, any> {
|
||||
return SponsorLogoViewDataBuilder.build(input);
|
||||
}
|
||||
|
||||
static build(
|
||||
static build(apiDto: MediaBinaryDTO): SponsorLogoViewData {
|
||||
static build(apiDto: GetMediaOutputDTO): SponsorLogoViewData {
|
||||
return {
|
||||
buffer: Buffer.from(apiDto.buffer).toString('base64'),
|
||||
contentType: apiDto.contentType,
|
||||
buffer: (apiDto as any).buffer ? Buffer.from((apiDto as any).buffer).toString('base64') : '',
|
||||
contentType: (apiDto as any).contentType || apiDto.type,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user