Skip to content

Commit

Permalink
refactor: removed recommended stream endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis3797 committed Jun 16, 2024
1 parent 39aad5c commit ac31d1a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
54 changes: 0 additions & 54 deletions apps/api/src/controller/stream.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,60 +337,6 @@ export const startStream = async (
}
};

export const getRecommended = async (
_: Request,
res: Response<
TypedResponse<{
streams: Array<
Stream & {
streamer: Pick<
User,
| "id"
| "username"
| "dispname"
| "avatar_url"
| "followerCount"
| "promotionPoints"
| "level"
>;
}
>;
}>
>
) => {
const streams = await prismaClient.stream.findMany({
where: {
active: true
},
include: {
streamer: {
select: {
id: true,
username: true,
dispname: true,
promotionPoints: true,
level: true,
avatar_url: true,
followerCount: true
}
}
},
orderBy: {
streamer: {
promotionPoints: Prisma.SortOrder.desc
}
}
});

return res.status(httpStatus.OK).json({
success: true,
data: {
streams
},
error: []
});
};

export const deleteStream = async (
req: Request<{ id: string }>,
res: Response<
Expand Down
2 changes: 0 additions & 2 deletions apps/api/src/routes/stream.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ streamRouter.post(
streamController.createStream
);

streamRouter.get("/recommended", streamController.getRecommended);

streamRouter.get("/:id", streamController.getStreamInfo);

streamRouter.put("/:id/start", streamController.startStream);
Expand Down

0 comments on commit ac31d1a

Please sign in to comment.