channel: made avatar, banner and description optional

nextui
Guus van Meerveld 5 months ago
parent 8d112266f1
commit 7447eb3fbf

@ -169,10 +169,10 @@ export default class Transformer {
return {
name: data.name,
id: data.id,
description: data.description,
avatar: data.avatarUrl,
description: data.description ?? undefined,
avatar: data.avatarUrl ?? undefined,
subscribers: data.subscriberCount,
banner: data.bannerUrl,
banner: data.bannerUrl ?? undefined,
verified: data.verified
};
}

@ -14,9 +14,9 @@ export const tabType = z.enum(tabEnum);
export const ChannelModel = z.object({
id: z.string(),
name: z.string(),
avatarUrl: z.string().url(),
bannerUrl: z.string().url(),
description: z.string(),
avatarUrl: z.string().url().nullable(),
bannerUrl: z.string().url().nullable(),
description: z.string().nullable(),
nextpage: z.string().nullable(),
subscriberCount: z.number(),
verified: z.boolean(),

@ -3,7 +3,7 @@ import { Author } from "./author";
export interface Channel extends Author {
id: string;
subscribers: number;
description: string;
avatar: string;
description?: string;
avatar?: string;
banner?: string;
}

Loading…
Cancel
Save