refactor: Rename func for getting homepage data
This commit is contained in:
parent
714078980c
commit
33aee1875e
3 changed files with 5 additions and 4 deletions
|
@ -1,8 +1,9 @@
|
|||
import type { Track, TrackVersion } from '@prisma/client';
|
||||
|
||||
export interface Database {
|
||||
listTracksWithProducer: (producerId: string) => Promise<
|
||||
listTracksForTrackCard: (producerId: string) => Promise<
|
||||
{
|
||||
id: number;
|
||||
title: string;
|
||||
version: number;
|
||||
producer: string;
|
||||
|
@ -10,7 +11,7 @@ export interface Database {
|
|||
author: string;
|
||||
content: string;
|
||||
createdAt: Date;
|
||||
};
|
||||
}[];
|
||||
}[]
|
||||
>;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ export class DatabasePrisma implements Database {
|
|||
this.client = new PrismaClient();
|
||||
}
|
||||
|
||||
listTracksWithProducer = async (producerId: string) => {
|
||||
listTracksForTrackCard = async (producerId: string) => {
|
||||
const tracks = await this.client.track.findMany({
|
||||
select: {
|
||||
title: true,
|
||||
|
|
|
@ -8,7 +8,7 @@ export const load: PageServerLoad = async ({ locals: { authReq, database } }) =>
|
|||
tracks: []
|
||||
};
|
||||
|
||||
const tracks = await database.listTracksWithProducer(session.user.userId);
|
||||
const tracks = await database.listTracksForTrackCard(session.user.userId);
|
||||
|
||||
return {
|
||||
tracks
|
||||
|
|
Loading…
Reference in a new issue