Update serverfolder enable/disable

This commit is contained in:
jeffvli
2022-10-27 00:58:59 -07:00
parent 88e716b970
commit cbbf3087ff
8 changed files with 157 additions and 14 deletions
+7 -2
View File
@@ -1,4 +1,5 @@
import { Prisma } from '@prisma/client';
import { AuthUser } from '@middleware/authenticate';
const include = () => {
const props: Prisma.SongInclude = {
@@ -16,7 +17,7 @@ const include = () => {
return props;
};
const findMany = () => {
const findMany = (user: AuthUser) => {
const props: Prisma.SongFindManyArgs = {
include: {
album: true,
@@ -26,7 +27,11 @@ const findMany = () => {
images: true,
ratings: true,
server: {
include: { serverUrls: true },
include: {
serverUrls: {
where: { userServerUrls: { some: { userId: user.id } } },
},
},
},
},
orderBy: [