pretty + better handling + handling in artist detail view

This commit is contained in:
danis
2023-09-18 16:45:03 +02:00
parent 431427d7ad
commit bc227fb0ea
8 changed files with 106 additions and 84 deletions

View File

@@ -7,9 +7,13 @@ export const LikedSongValidator = yup
.object({
songId: yup.number().required(),
addedDate: yup.date().required(),
}).concat(ModelValidator);
})
.concat(ModelValidator);
export const LikedSongHandler: ResponseHandler<yup.InferType<typeof LikedSongValidator>, LikedSong> = {
export const LikedSongHandler: ResponseHandler<
yup.InferType<typeof LikedSongValidator>,
LikedSong
> = {
validator: LikedSongValidator,
transformer: (likedSong) => ({
id: likedSong.id,
@@ -20,10 +24,10 @@ export const LikedSongHandler: ResponseHandler<yup.InferType<typeof LikedSongVal
interface LikedSong extends Model {
songId: number;
addedDate: Date;
};
}
export interface LikedSongWithDetails extends LikedSong {
details: Song;
}
export default LikedSong;
export default LikedSong;