Fix album permissions by role

This commit is contained in:
jeffvli
2022-11-13 04:56:36 -08:00
parent 4e2325f05d
commit 1a6c4af5df
4 changed files with 28 additions and 17 deletions
+5 -2
View File
@@ -8,9 +8,12 @@ const getDetail = async (
req: TypedRequest<typeof validation.albums.detail>,
res: Response
) => {
const { albumId } = req.params;
const { albumId, serverId } = req.params;
const album = await service.albums.findById(req.authUser, { id: albumId });
const album = await service.albums.findById(req.authUser, {
id: albumId,
serverId,
});
const success = ApiSuccess.ok({
data: toApiModel.albums({ items: [album], user: req.authUser })[0],