add sqlite compatibility + fix whitespace bug collections

This commit is contained in:
Jordan Higuera Higuera
2023-08-03 21:33:51 -07:00
parent 264ea03e63
commit 22093c0c29
8 changed files with 130 additions and 67 deletions
+6 -1
View File
@@ -33,11 +33,16 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
where: {
id: queryId,
},
include: {
whitelistedUsers: true
}
});
const whitelistedUsernames = targetUser?.whitelistedUsers.map(whitelistedUsername => whitelistedUsername.username);
if (
targetUser?.isPrivate &&
!targetUser.whitelistedUsers.includes(username)
!whitelistedUsernames?.includes(username)
) {
return res
.setHeader("Content-Type", "text/plain")