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 { return {
name: data.name, name: data.name,
id: data.id, id: data.id,
description: data.description, description: data.description ?? undefined,
avatar: data.avatarUrl, avatar: data.avatarUrl ?? undefined,
subscribers: data.subscriberCount, subscribers: data.subscriberCount,
banner: data.bannerUrl, banner: data.bannerUrl ?? undefined,
verified: data.verified verified: data.verified
}; };
} }

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

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

Loading…
Cancel
Save